clippy
50 errors, 126 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 50 |
Warning | 126 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.73.0 (cc66ad468 2023-10-03)
- cargo 1.73.0 (9c4383fb5 2023-08-26)
- clippy 0.1.73 (cc66ad4 2023-10-03)
Annotations
Check warning on line 215 in src/interop/packwiz.rs
github-actions / clippy
unused `async` for function with no await statements
warning: unused `async` for function with no await statements
--> src/interop/packwiz.rs:186:5
|
186 | / pub async fn resolved_to_mod(&self, resolved_file: &ResolvedFile) -> Result<Mod> {
187 | | let hash = App::get_best_hash(&resolved_file.hashes);
188 | |
189 | | let (hash_format, hash) = match hash {
... |
214 | | })
215 | | }
| |_____^
|
= help: consider removing the `async` from this function
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_async
Check warning on line 99 in src/commands/cache.rs
github-actions / clippy
unused `async` for function with no await statements
warning: unused `async` for function with no await statements
--> src/commands/cache.rs:25:1
|
25 | / pub async fn run(commands: Commands) -> Result<()> {
26 | | let Some(cache_folder) = Cache::cache_root() else {
27 | | bail!("Cache directory was missing, maybe it's disabled?");
28 | | };
... |
98 | | Ok(())
99 | | }
| |_^
|
= help: consider removing the `async` from this function
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_async
Check warning on line 72 in src/commands/world/unpack.rs
github-actions / clippy
unused `async` for function with no await statements
warning: unused `async` for function with no await statements
--> src/commands/world/unpack.rs:15:1
|
15 | / pub async fn run(app: App, args: Args) -> Result<()> {
16 | | let zipfile = if let Some(s) = args.world {
17 | | app.server.path.join("worlds").join(if s.ends_with(".zip") {
18 | | s.clone()
... |
71 | | Ok(())
72 | | }
| |_^
|
= help: consider removing the `async` from this function
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_async
Check warning on line 166 in src/commands/add/modrinth.rs
github-actions / clippy
unused `async` for function with no await statements
warning: unused `async` for function with no await statements
--> src/commands/add/modrinth.rs:16:1
|
16 | / pub async fn run(mut app: App, args: Args) -> Result<()> {
17 | | let query = if let Some(s) = args.search {
18 | | s.to_owned()
19 | | } else {
... |
165 | | Ok(())
166 | | }
| |_^
|
= help: consider removing the `async` from this function
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_async
Check warning on line 26 in src/commands/export/packwiz.rs
github-actions / clippy
unused `async` for function with no await statements
warning: unused `async` for function with no await statements
--> src/commands/export/packwiz.rs:17:1
|
17 | / pub async fn run(app: App, args: Args) -> Result<()> {
18 | | let default_output = app.server.path.join("pack");
19 | | let output_dir = args.output.unwrap_or(default_output);
20 | |
... |
25 | | Ok(())
26 | | }
| |_^
|
= help: consider removing the `async` from this function
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_async
= note: `#[warn(clippy::unused_async)]` implied by `#[warn(clippy::pedantic)]`
Check warning on line 89 in src/main.rs
github-actions / clippy
matching over `()` is more explicit
warning: matching over `()` is more explicit
--> src/main.rs:89:93
|
89 | Commands::Build(args) => commands::build::run(base_app.upgrade()?, args).await.map(|_| ()),
| ^ help: use `()` instead of `_`: `()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
Check failure on line 30 in src/main.rs
github-actions / clippy
name `CLI` contains a capitalized acronym
error: name `CLI` contains a capitalized acronym
--> src/main.rs:30:8
|
30 | struct CLI {
| ^^^ help: consider making the acronym lowercase, except the initial letter: `Cli`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
= note: `#[deny(clippy::upper_case_acronyms)]` implied by `#[deny(clippy::all)]`
Check warning on line 207 in src/hot_reload/mod.rs
github-actions / clippy
this argument is passed by value, but not consumed in the function body
warning: this argument is passed by value, but not consumed in the function body
--> src/hot_reload/mod.rs:207:14
|
207 | _tx: mpsc::Sender<Command>,
| ^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&mpsc::Sender<Command>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
Check warning on line 174 in src/hot_reload/mod.rs
github-actions / clippy
consider adding a `;` to the last statement for consistent formatting
warning: consider adding a `;` to the last statement for consistent formatting
--> src/hot_reload/mod.rs:171:25
|
171 | / println!(
172 | | "{}{s}",
173 | | style("| ").bold()
174 | | )
| |_________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a `;` here
|
171 ~ println!(
172 + "{}{s}",
173 + style("| ").bold()
174 + );
|
Check warning on line 159 in src/hot_reload/mod.rs
github-actions / clippy
matching over `()` is more explicit
warning: matching over `()` is more explicit
--> src/hot_reload/mod.rs:159:36
|
159 | ... Ok(_) => {},
| ^ help: use `()` instead of `_`: `()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
Check warning on line 131 in src/hot_reload/mod.rs
github-actions / clippy
matching over `()` is more explicit
warning: matching over `()` is more explicit
--> src/hot_reload/mod.rs:131:37
|
131 | ... _ = tokio::time::sleep(Duration::from_secs(30)) => {
| ^ help: use `()` instead of `_`: `()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
Check warning on line 117 in src/hot_reload/mod.rs
github-actions / clippy
matching over `()` is more explicit
warning: matching over `()` is more explicit
--> src/hot_reload/mod.rs:117:37
|
117 | ... _ = async {
| ^ help: use `()` instead of `_`: `()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: `#[warn(clippy::ignored_unit_patterns)]` implied by `#[warn(clippy::pedantic)]`
Check warning on line 125 in src/hot_reload/mod.rs
github-actions / clippy
consider adding a `;` to the last statement for consistent formatting
warning: consider adding a `;` to the last statement for consistent formatting
--> src/hot_reload/mod.rs:121:53
|
121 | / ... println!(
122 | | ... "{}{}",
123 | | ... style("| ").bold(),
124 | | ... line.trim()
125 | | ... )
| |_______________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a `;` here
|
121 ~ println!(
122 + "{}{}",
123 + style("| ").bold(),
124 + line.trim()
125 + );
|
Check warning on line 202 in src/hot_reload/mod.rs
github-actions / clippy
this function has too many lines (120/100)
warning: this function has too many lines (120/100)
--> src/hot_reload/mod.rs:72:5
|
72 | / async fn handle_commands(mut self, mut rx: mpsc::Receiver<Command>) -> Result<()> {
73 | | let mp = self.builder.app.multi_progress.clone();
74 | |
75 | | let mut child: Option<Child> = None;
... |
201 | | Ok(())
202 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines
Check failure on line 59 in src/hot_reload/mod.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hot_reload/mod.rs:59:25
|
59 | &self.builder.app,
| ^^^^^^^^^^^^^^^^^ help: change this to: `self.builder.app`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check failure on line 10 in src/hot_reload/pattern_serde.rs
github-actions / clippy
question mark operator is useless here
error: question mark operator is useless here
--> src/hot_reload/pattern_serde.rs:9:5
|
9 | / Ok(Pattern::new(&String::deserialize(de)?)
10 | | .map_err(serde::de::Error::custom)?)
| |________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
help: try removing question mark and `Ok()`
|
9 ~ Pattern::new(&String::deserialize(de)?)
10 + .map_err(serde::de::Error::custom)
|
Check warning on line 73 in src/hot_reload/config.rs
github-actions / clippy
implicitly cloning a `PathBuf` by calling `to_owned` on its dereferenced type
warning: implicitly cloning a `PathBuf` by calling `to_owned` on its dereferenced type
--> src/hot_reload/config.rs:73:18
|
73 | h.path = path.to_owned();
| ^^^^^^^^^^^^^^^ help: consider using: `path.clone()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
Check failure on line 33 in src/hot_reload/config.rs
github-actions / clippy
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> src/hot_reload/config.rs:33:1
|
33 | impl Into<String> for HotReloadAction {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
= note: `#[deny(clippy::from_over_into)]` implied by `#[deny(clippy::all)]`
help: replace the `Into` implementation with `From<hot_reload::config::HotReloadAction>`
|
33 ~ impl From<HotReloadAction> for String {
34 ~ fn from(val: HotReloadAction) -> Self {
35 ~ match val {
|
Check warning on line 43 in src/interop/markdown.rs
github-actions / clippy
consider adding a `;` to the last statement for consistent formatting
warning: consider adding a `;` to the last statement for consistent formatting
--> src/interop/markdown.rs:41:17
|
41 | / content = re.replace_all(&content, |_caps: ®ex::Captures| {
42 | | format!("<!--start:mcman-{id}-->\n{}\n<!--end:mcman-{id}-->", table.render())
43 | | }).to_string()
| |______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a `;` here
|
41 ~ content = re.replace_all(&content, |_caps: ®ex::Captures| {
42 + format!("<!--start:mcman-{id}-->\n{}\n<!--end:mcman-{id}-->", table.render())
43 + }).to_string();
|
Check warning on line 207 in src/interop/packwiz.rs
github-actions / clippy
this match arm has an identical body to the `_` wildcard arm
warning: this match arm has an identical body to the `_` wildcard arm
--> src/interop/packwiz.rs:207:21
|
207 | "md5" => HashFormat::Md5,
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the arm
|
= help: or try changing either arm body
note: `_` wildcard arm here
--> src/interop/packwiz.rs:209:21
|
209 | _ => HashFormat::Md5,
| ^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
Check warning on line 195 in src/interop/packwiz.rs
github-actions / clippy
this could be rewritten as `let...else`
warning: this could be rewritten as `let...else`
--> src/interop/packwiz.rs:189:9
|
189 | / let (hash_format, hash) = match hash {
190 | | Some(t) => t,
191 | | None => {
192 | | // TODO calculate hash manually (by cached file or download it and compute)
193 | | todo!()
194 | | }
195 | | };
| |__________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
= note: `#[warn(clippy::manual_let_else)]` implied by `#[warn(clippy::pedantic)]`
help: consider writing
|
189 ~ let Some((hash_format, hash)) = hash else {
190 + // TODO calculate hash manually (by cached file or download it and compute)
191 + todo!()
192 + };
|
Check failure on line 179 in src/interop/packwiz.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/interop/packwiz.rs:179:42
|
179 | let resolved = dl.resolve_source(&self.0).await?;
| ^^^^^^^ help: change this to: `self.0`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check failure on line 170 in src/interop/packwiz.rs
github-actions / clippy
useless use of `format!`
error: useless use of `format!`
--> src/interop/packwiz.rs:170:29
|
170 | self.0.warn(format!("unknown mod update"))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"unknown mod update".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
Check failure on line 156 in src/interop/packwiz.rs
github-actions / clippy
methods called `from_*` usually take no `self`
error: methods called `from_*` usually take no `self`
--> src/interop/packwiz.rs:156:28
|
156 | pub fn from_mod_update(&self, mod_update: &Option<ModUpdate>) -> Result<Option<Downloadable>> {
| ^^^^^
|
= help: consider choosing a less ambiguous name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
Check warning on line 153 in src/interop/packwiz.rs
github-actions / clippy
unnecessary boolean `not` operation
warning: unnecessary boolean `not` operation
--> src/interop/packwiz.rs:140:9
|
140 | / if !down.hash.is_empty() {
141 | | let fmt = match down.hash_format {
142 | | HashFormat::Sha512 => "sha512",
143 | | HashFormat::Sha1 => "sha1",
... |
152 | | Ok(None)
153 | | }
| |_________^
|
= help: remove the `!` and swap the blocks of the `if`/`else`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_not_else
= note: `#[warn(clippy::if_not_else)]` implied by `#[warn(clippy::pedantic)]`