Skip to content
GitHub Actions / clippy failed Jun 19, 2024 in 2s

clippy

28 errors, 121 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 28
Warning 121
Note 0
Help 0

Versions

  • rustc 1.79.0 (129f3b996 2024-06-10)
  • cargo 1.79.0 (ffa9cf99a 2024-06-03)
  • clippy 0.1.79 (129f3b9 2024-06-10)

Annotations

Check warning on line 45 in src/api/utils/accessor.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/api/utils/accessor.rs:35:5
   |
35 | /     pub async fn dir(&self) -> Result<Vec<String>> {
36 | |         match self {
37 | |             Accessor::ZipLocal(zip) => Ok(zip.file_names().map(ToOwned::to_owned).collect()),
38 | |             Accessor::Local(path) => Ok(path
...  |
44 | |         }
45 | |     }
   | |_____^
   |
   = 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 46 in src/api/sources/fabric/mod.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/api/sources/fabric/mod.rs:25:5
   |
25 | /     pub async fn resolve_steps(
26 | |         &self,
27 | |         mc_version: &str,
28 | |         loader: &str,
...  |
45 | |         ])
46 | |     }
   | |_____^
   |
   = 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 113 in src/api/sources/maven/mod.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/api/sources/maven/mod.rs:76:5
    |
76  | /     pub async fn resolve_steps(
77  | |         &self,
78  | |         url: &str,
79  | |         group_id: &str,
...   |
112 | |         ])
113 | |     }
    | |_____^
    |
    = 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 65 in src/api/models/packwiz/mod.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/api/models/packwiz/mod.rs:35:5
   |
35 | /     pub async fn into_addon(&self, app: &App, target: AddonTarget) -> Result<Addon> {
36 | |         let addon_type = if let Some(update) = &self.update {
37 | |             match update {
38 | |                 PackwizModUpdate::Modrinth { mod_id, version } => AddonType::Modrinth {
...  |
64 | |         Ok(addon)
65 | |     }
   | |_____^
   |
   = 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 40 in src/api/models/mrpack/mod.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/api/models/mrpack/mod.rs:28:5
   |
28 | /     pub async fn into_addon(&self) -> Result<Addon> {
29 | |         Ok(Addon {
30 | |             environment: self.env.as_ref().map(|e| e.clone().into()),
31 | |             addon_type: AddonType::Url {
...  |
39 | |         })
40 | |     }
   | |_____^
   |
   = 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 40 in src/api/app/actions/init/mod.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/api/app/actions/init/mod.rs:30:5
   |
30 | /     pub async fn init_network(&mut self) -> Result<()> {
31 | |         intro("initializing network")?;
32 | |
33 | |         let name: String = input("Name of the network?").interact()?;
...  |
39 | |         Ok(())
40 | |     }
   | |_____^
   |
   = 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 28 in src/api/app/actions/init/mod.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/api/app/actions/init/mod.rs:13:5
   |
13 | /     pub async fn init_server(&mut self) -> Result<()> {
14 | |         intro("initializing server")?;
15 | |
16 | |         let name: String = input("Name of the server?").interact()?;
...  |
27 | |         Ok(())
28 | |     }
   | |_____^
   |
   = 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: `-W clippy::unused-async` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::unused_async)]`

Check failure on line 18 in src/commands/build.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/commands/build.rs:18:31
   |
18 |     app.action_install_addons(&base)
   |                               ^^^^^ help: change this to: `base`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check failure on line 15 in src/commands/build.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/commands/build.rs:15:28
   |
15 |     app.action_install_jar(&base)
   |                            ^^^^^ help: change this to: `base`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check failure on line 34 in src/api/utils/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

error: the borrowed expression implements the required traits
  --> src/api/utils/mod.rs:34:59
   |
34 |     let data: T = toml::from_str(&std::fs::read_to_string(&path)?)?;
   |                                                           ^^^^^ help: change this to: `path`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
   = note: `-D clippy::needless-borrows-for-generic-args` implied by `-D clippy::all`
   = help: to override `-D clippy::all` add `#[allow(clippy::needless_borrows_for_generic_args)]`

Check failure on line 72 in src/api/utils/pathdiff.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant guard

error: redundant guard
  --> src/api/utils/pathdiff.rs:72:39
   |
72 |                 (Some(_), Some(b)) if b == Component::ParentDir => return None,
   |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards
help: try
   |
72 -                 (Some(_), Some(b)) if b == Component::ParentDir => return None,
72 +                 (Some(_), Some(Component::ParentDir)) => return None,
   |

Check failure on line 71 in src/api/utils/pathdiff.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant guard

error: redundant guard
  --> src/api/utils/pathdiff.rs:71:39
   |
71 |                 (Some(a), Some(b)) if b == Component::CurDir => comps.push(a),
   |                                       ^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards
   = note: `-D clippy::redundant-guards` implied by `-D clippy::all`
   = help: to override `-D clippy::all` add `#[allow(clippy::redundant_guards)]`
help: try
   |
71 -                 (Some(a), Some(b)) if b == Component::CurDir => comps.push(a),
71 +                 (Some(a), Some(Component::CurDir)) => comps.push(a),
   |

Check warning on line 85 in src/api/utils/pathdiff.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary `!=` operation

warning: unnecessary `!=` operation
  --> src/api/utils/pathdiff.rs:51:5
   |
51 | /     if path.is_absolute() != base.is_absolute() {
52 | |         if path.is_absolute() {
53 | |             Some(PathBuf::from(path))
54 | |         } else {
...  |
84 | |         Some(comps.iter().map(|c| c.as_os_str()).collect())
85 | |     }
   | |_____^
   |
   = help: change to `==` 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: `-W clippy::if-not-else` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::if_not_else)]`

Check warning on line 23 in src/api/utils/pathdiff.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of wildcard import

warning: usage of wildcard import
  --> src/api/utils/pathdiff.rs:23:5
   |
23 | use std::path::*;
   |     ^^^^^^^^^^^^ help: try: `std::path::{Component, Path, PathBuf}`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports

Check warning on line 1 in src/api/utils/pathdiff.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should put bare URLs between `<`/`>` or make a proper Markdown link

warning: you should put bare URLs between `<`/`>` or make a proper Markdown link
 --> src/api/utils/pathdiff.rs:1:5
  |
1 | //! https://github.com/Manishearth/pathdiff
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown

Check failure on line 58 in src/api/utils/hashing/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

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

error: using `clone` on type `HashFormat` which implements the `Copy` trait
  --> src/api/utils/hashing/mod.rs:58:24
   |
58 |         .map(|(k, v)| (k.clone(), v.clone()))
   |                        ^^^^^^^^^ help: try dereferencing it: `*k`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
   = note: `-D clippy::clone-on-copy` implied by `-D clippy::all`
   = help: to override `-D clippy::all` add `#[allow(clippy::clone_on_copy)]`

Check warning on line 25 in src/api/utils/hashing/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)

warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
  --> src/api/utils/hashing/mod.rs:25:23
   |
25 |     pub fn get_digest(&self) -> Box<dyn DynDigest> {
   |                       ^^^^^ help: consider passing by value instead: `self`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref

Check warning on line 24 in src/api/utils/hashing/curseforge.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/api/utils/hashing/curseforge.rs:24:9
   |
24 |         self.0 = Vec::new()
   |         ^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `self.0 = Vec::new();`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

Check warning on line 18 in src/api/utils/hashing/curseforge.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/api/utils/hashing/curseforge.rs:14:9
   |
14 | /         self.0.extend(
15 | |             data.iter()
16 | |                 .copied()
17 | |                 .filter(|&e| e != 9 && e != 10 && e != 13 && e != 32),
18 | |         )
   | |_________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
   = note: `-W clippy::semicolon-if-nothing-returned` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::semicolon_if_nothing_returned)]`
help: add a `;` here
   |
14 ~         self.0.extend(
15 +             data.iter()
16 +                 .copied()
17 +                 .filter(|&e| e != 9 && e != 10 && e != 13 && e != 32),
18 +         );
   |

Check warning on line 40 in src/api/utils/accessor.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant closure

warning: redundant closure
  --> src/api/utils/accessor.rs:40:29
   |
40 |                 .filter_map(|r| r.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
   = note: `-W clippy::redundant-closure-for-method-calls` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::redundant_closure_for_method_calls)]`

Check warning on line 26 in src/api/utils/accessor.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

case-sensitive file extension comparison

warning: case-sensitive file extension comparison
  --> src/api/utils/accessor.rs:26:19
   |
26 |         } else if str.ends_with(".zip") || str.ends_with(".mrpack") {
   |                   ^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider using a case-insensitive comparison instead
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#case_sensitive_file_extension_comparisons
help: use std::path::Path
   |
26 ~         } else if std::path::Path::new(str)
27 +             .extension()
28 ~             .map_or(false, |ext| ext.eq_ignore_ascii_case("zip")) || str.ends_with(".mrpack") {
   |

Check warning on line 32 in src/api/sources/hangar/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `self` argument

warning: unused `self` argument
  --> src/api/sources/hangar/mod.rs:32:29
   |
32 |     pub fn get_download_url(&self, id: &str, version: &str, platform: &str) -> String {
   |                             ^^^^^
   |
   = help: consider refactoring to an associated function
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
   = note: `-W clippy::unused-self` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::unused_self)]`

Check failure on line 268 in src/api/sources/hangar/models.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

empty doc comment

error: empty doc comment
   --> src/api/sources/hangar/models.rs:268:1
    |
268 | ///
    | ^^^
    |
    = help: consider removing or filling it
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs
    = note: `-D clippy::empty-docs` implied by `-D clippy::all`
    = help: to override `-D clippy::all` add `#[allow(clippy::empty_docs)]`

Check failure on line 188 in src/api/sources/hangar/models.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

error: direct implementation of `ToString`
   --> src/api/sources/hangar/models.rs:180:1
    |
180 | / impl ToString for Platform {
181 | |     fn to_string(&self) -> String {
182 | |         match self {
183 | |             Self::Paper => "PAPER".to_owned(),
...   |
187 | |     }
188 | | }
    | |_^
    |
    = help: prefer implementing `Display` instead
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl

Check failure on line 16 in src/api/sources/hangar/models.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

error: direct implementation of `ToString`
  --> src/api/sources/hangar/models.rs:12:1
   |
12 | / impl ToString for Namespace {
13 | |     fn to_string(&self) -> String {
14 | |         format!("{}/{}", self.owner, self.slug)
15 | |     }
16 | | }
   | |_^
   |
   = help: prefer implementing `Display` instead
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl