Skip to content
GitHub Actions / clippy failed Nov 15, 2023 in 4s

clippy

60 errors, 129 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 60
Warning 129
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 189 in src/commands/init/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

calls to `std::mem::drop` with a reference instead of an owned value does nothing

warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
   --> src/commands/init/mod.rs:189:17
    |
189 |                 drop(nw);
    |                 ^^^^^--^
    |                      |
    |                      argument has type `&mut model::network::Network`
    |
    = note: use `let _ = ...` to ignore the expression or result
    = note: `#[warn(dropping_references)]` on by default

Check warning on line 229 in src/interop/packwiz.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `async` for function with no await statements

warning: unused `async` for function with no await statements
   --> src/interop/packwiz.rs:200:5
    |
200 | /     pub async fn resolved_to_mod(&self, resolved_file: &ResolvedFile) -> Result<Mod> {
201 | |         let hash = App::get_best_hash(&resolved_file.hashes);
202 | |
203 | |         let (hash_format, hash) = match hash {
...   |
228 | |         })
229 | |     }
    | |_____^
    |
    = 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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 failure on line 30 in src/main.rs

See this annotation in the file changed.

@github-actions 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 385 in src/hot_reload/mod.rs

See this annotation in the file changed.

@github-actions 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:385:14
    |
385 |         _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 failure on line 341 in src/hot_reload/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `SystemTime` which implements the `Copy` trait

error: using `clone` on type `SystemTime` which implements the `Copy` trait
   --> src/hot_reload/mod.rs:341:58
    |
341 | ...                   .max_by_key(|(_, t)| t.clone())
    |                                            ^^^^^^^^^ help: try dereferencing it: `*t`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 339 in src/hot_reload/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant closure

warning: redundant closure
   --> src/hot_reload/mod.rs:339:49
    |
339 | ...                   .filter_map(|f| f.ok())
    |                                   ^^^^^^^^^^ help: replace the closure with the method itself: `std::result::Result::ok`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls

Check failure on line 338 in src/hot_reload/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `std::fs::ReadDir`

error: useless conversion to the same type: `std::fs::ReadDir`
   --> src/hot_reload/mod.rs:337:56
    |
337 |   ...                   let (report_path, _) = folder.read_dir()?
    |  ______________________________________________^
338 | | ...                       .into_iter()
    | |______________________________________^ help: consider removing `.into_iter()`: `folder.read_dir()?`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
    = note: `#[deny(clippy::useless_conversion)]` implied by `#[deny(clippy::all)]`

Check failure on line 320 in src/hot_reload/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you seem to be trying to use `match` for an equality check. Consider using `if`

error: you seem to be trying to use `match` for an equality check. Consider using `if`
   --> src/hot_reload/mod.rs:313:25
    |
313 | /                         match test_result {
314 | |                             TestResult::Crashed => {
315 | |                                 println!(
316 | |                                     "  - Server crashed"
...   |
319 | |                             _ => {}
320 | |                         }
    | |_________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
    = note: `#[deny(clippy::single_match)]` implied by `#[deny(clippy::all)]`
help: try
    |
313 ~                         if test_result == TestResult::Crashed {
314 +                             println!(
315 +                                 "  - Server crashed"
316 +                             );
317 +                         }
    |

Check warning on line 230 in src/hot_reload/mod.rs

See this annotation in the file changed.

@github-actions 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:227:25
    |
227 | /                         println!(
228 | |                             "{}{s}",
229 | |                             style("| ").bold()
230 | |                         )
    | |_________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a `;` here
    |
227 ~                         println!(
228 +                             "{}{s}",
229 +                             style("| ").bold()
230 +                         );
    |

Check warning on line 190 in src/hot_reload/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

matching over `()` is more explicit

warning: matching over `()` is more explicit
   --> src/hot_reload/mod.rs:190:36
    |
190 | ...                   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 161 in src/hot_reload/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

matching over `()` is more explicit

warning: matching over `()` is more explicit
   --> src/hot_reload/mod.rs:161:37
    |
161 | ...                   _ = 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 141 in src/hot_reload/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

matching over `()` is more explicit

warning: matching over `()` is more explicit
   --> src/hot_reload/mod.rs:141:37
    |
141 | ...                   _ = 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 150 in src/hot_reload/mod.rs

See this annotation in the file changed.

@github-actions 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:146:53
    |
146 | / ...                   println!(
147 | | ...                       "{}{}",
148 | | ...                       style("| ").bold(),
149 | | ...                       line.trim()
150 | | ...                   )
    | |_______________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a `;` here
    |
146 ~                                                     println!(
147 +                                                         "{}{}",
148 +                                                         style("| ").bold(),
149 +                                                         line.trim()
150 +                                                     );
    |

Check warning on line 381 in src/hot_reload/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many lines (254/100)

warning: this function has too many lines (254/100)
   --> src/hot_reload/mod.rs:92:5
    |
92  | /     async fn handle_commands(mut self, mut rx: mpsc::Receiver<Command>, mut tx: mpsc::Sender<Command>) -> Result<()> {
93  | |         let mp = self.builder.app.multi_progress.clone();
94  | |
95  | |         let mut child: Option<Child> = None;
...   |
380 | |         Ok(())
381 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines

Check failure on line 10 in src/hot_reload/pattern_serde.rs

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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
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 83 in src/interop/markdown.rs

See this annotation in the file changed.

@github-actions 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:81:17
   |
81 | /                 content = re.replace_all(&content, |_caps: &regex::Captures| {
82 | |                     format!("<!--start:mcman-{id}-->\n{}\n<!--end:mcman-{id}-->", table.render())
83 | |                 }).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
   |
81 ~                 content = re.replace_all(&content, |_caps: &regex::Captures| {
82 +                     format!("<!--start:mcman-{id}-->\n{}\n<!--end:mcman-{id}-->", table.render())
83 +                 }).to_string();
   |

Check warning on line 221 in src/interop/packwiz.rs

See this annotation in the file changed.

@github-actions 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:221:21
    |
221 |                     "md5" => HashFormat::Md5,
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the arm
    |
    = help: or try changing either arm body
note: `_` wildcard arm here
   --> src/interop/packwiz.rs:223:21
    |
223 |                     _ => HashFormat::Md5,
    |                     ^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms

Check warning on line 209 in src/interop/packwiz.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this could be rewritten as `let...else`

warning: this could be rewritten as `let...else`
   --> src/interop/packwiz.rs:203:9
    |
203 | /         let (hash_format, hash) = match hash {
204 | |             Some(t) => t,
205 | |             None => {
206 | |                 // TODO calculate hash manually (by cached file or download it and compute)
207 | |                 todo!()
208 | |             }
209 | |         };
    | |__________^
    |
    = 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
    |
203 ~         let Some((hash_format, hash)) = hash else {
204 +                 // TODO calculate hash manually (by cached file or download it and compute)
205 +                 todo!()
206 +             };
    |

Check failure on line 193 in src/interop/packwiz.rs

See this annotation in the file changed.

@github-actions 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:193:42
    |
193 |         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