Skip to content
GitHub Actions / clippy failed Nov 11, 2023 in 2s

clippy

55 errors, 111 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 55
Warning 111
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

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: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

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 363 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:363:14
    |
363 |         _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 322 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:322:50
    |
322 | ...                   .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 320 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:320:41
    |
320 | ...                   .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 319 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:318:48
    |
318 |                           let (report_path, _) = folder.read_dir()?
    |  ________________________________________________^
319 | |                             .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 301 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 destructuring a single pattern. Consider using `if let`

error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> src/hot_reload/mod.rs:294:17
    |
294 | /                 match test_result {
295 | |                     TestResult::Crashed => {
296 | |                         println!(
297 | |                             "  - Server crashed"
...   |
300 | |                     _ => {}
301 | |                 }
    | |_________________^
    |
    = 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
    |
294 ~                 if let TestResult::Crashed = test_result {
295 +                     println!(
296 +                         "  - Server crashed"
297 +                     );
298 +                 }
    |

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

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 358 in src/hot_reload/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many lines (233/100)

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

Check failure on line 80 in src/hot_reload/mod.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/hot_reload/mod.rs:80:25
   |
80 |                         &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

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 43 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:41:17
   |
41 | /                 content = re.replace_all(&content, |_caps: &regex::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: &regex::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

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: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

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: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

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: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