Skip to content
GitHub Actions / clippy failed Jun 17, 2024 in 1s

clippy

19 errors, 83 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 19
Warning 83
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 41 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:32:5
   |
32 | /     pub async fn dir(&self) -> Result<Vec<String>> {
33 | |         match self {
34 | |             Accessor::ZipLocal(zip) => Ok(zip.file_names().map(ToOwned::to_owned).collect()),
35 | |             Accessor::Local(path) => Ok(path.read_dir()?
...  |
40 | |         }
41 | |     }
   | |_____^
   |
   = 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:27:5
   |
27 | /     pub async fn init_network(&mut self) -> Result<()> {
28 | |         intro("initializing network")?;
29 | |
30 | |         let name: String = input("Name of the network?")
...  |
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 25 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:10:5
   |
10 | /     pub async fn init_server(&mut self) -> Result<()> {
11 | |         intro("initializing server")?;
12 | |
13 | |         let name: String = input("Name of the server?")
...  |
24 | |         Ok(())
25 | |     }
   | |_____^
   |
   = 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 12 in src/api/app/actions/build/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/build/mod.rs:8:5
   |
8  | /     pub async fn action_install_jar(&self) -> Result<()> {
9  | |         
10 | |         
11 | |         Ok(())
12 | |     }
   | |_____^
   |
   = 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 37 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:31:5
   |
31 | /     pub async fn into_addon(&self) -> Result<Addon> {
32 | |         Ok(Addon {
33 | |             environment: self.env.as_ref().map(|e| e.clone().into()),
34 | |             addon_type: AddonType::Url { url: self.downloads.first().ok_or(anyhow!("No downloads"))?.clone() },
35 | |             target: AddonTarget::from_path(&self.path),
36 | |         })
37 | |     }
   | |_____^
   |
   = 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 61 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:38:5
   |
38 | /     pub async fn into_addon(&self, app: &App, target: AddonTarget) -> Result<Addon> {
39 | |         let addon_type = if let Some(update) = &self.update {
40 | |             match update {
41 | |                 PackwizModUpdate::Modrinth { mod_id, version } => AddonType::Modrinth { id: mod_id.clone(), version: version.clone() },
...  |
60 | |         Ok(addon)
61 | |     }
   | |_____^
   |
   = 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 28 in src/api/sources/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `std::string::String`

error: useless conversion to the same type: `std::string::String`
  --> src/api/sources/mod.rs:28:18
   |
28 |             url: url.into(),
   |                  ^^^^^^^^^^ help: consider removing `.into()`: `url`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
   = note: `-D clippy::useless-conversion` implied by `-D clippy::all`
   = help: to override `-D clippy::all` add `#[allow(clippy::useless_conversion)]`

Check failure on line 28 in src/api/sources/modrinth/mod.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/api/sources/modrinth/mod.rs:28:9
   |
28 |         Ok(self.fetch_all_versions(id).await?)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.fetch_all_versions(id).await`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark

Check warning on line 57 in src/api/sources/vanilla/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

wildcard matches only a single variant and will also match any future added variants

warning: wildcard matches only a single variant and will also match any future added variants
  --> src/api/sources/vanilla/mod.rs:57:13
   |
57 |             _ => bail!("You cant have both smh"),
   |             ^ help: try: `Environment::Both`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants
   = note: `-W clippy::match-wildcard-for-single-variants` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::match_wildcard_for_single_variants)]`

Check failure on line 15 in src/api/sources/vanilla/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

methods called `into_*` usually take `self` by value

error: methods called `into_*` usually take `self` by value
  --> src/api/sources/vanilla/mod.rs:15:22
   |
15 |     pub fn into_step(&self, ty: DownloadType) -> Option<Vec<Step>> {
   |                      ^^^^^
   |
   = 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 179 in src/api/sources/vanilla/version.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

warning: item in documentation is missing backticks
   --> src/api/sources/vanilla/version.rs:179:10
    |
179 |     /// (AssetIndex only) The size of the game version's assets
    |          ^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
    |
179 |     /// (`AssetIndex` only) The size of the game version's assets
    |          ~~~~~~~~~~~~

Check warning on line 177 in src/api/sources/vanilla/version.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

warning: item in documentation is missing backticks
   --> src/api/sources/vanilla/version.rs:177:10
    |
177 |     /// (AssetIndex only) The game version ID the assets are for
    |          ^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
    |
177 |     /// (`AssetIndex` only) The game version ID the assets are for
    |          ~~~~~~~~~~~~

Check warning on line 149 in src/api/sources/vanilla/version.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

warning: item in documentation is missing backticks
   --> src/api/sources/vanilla/version.rs:149:13
    |
149 |     /// The HashMap key specifies a classifier as additional information for downloading files
    |             ^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
    |
149 |     /// The `HashMap` key specifies a classifier as additional information for downloading files
    |             ~~~~~~~~~

Check warning on line 87 in src/api/sources/vanilla/version.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

possible intra-doc link using quotes instead of backticks

warning: possible intra-doc link using quotes instead of backticks
  --> src/api/sources/vanilla/version.rs:87:25
   |
87 |     ///     "exclude": ["META-INF/"],
   |                         ^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_link_with_quotes
   = note: `-W clippy::doc-link-with-quotes` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_link_with_quotes)]`

Check failure on line 70 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:70:39
   |
70 |                 (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
   |
70 -                 (Some(_), Some(b)) if b == Component::ParentDir => return None,
70 +                 (Some(_), Some(Component::ParentDir)) => return None,
   |

Check failure on line 69 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:69:39
   |
69 |                 (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
   |
69 -                 (Some(a), Some(b)) if b == Component::CurDir => comps.push(a),
69 +                 (Some(a), Some(Component::CurDir)) => comps.push(a),
   |

Check warning on line 83 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:49:5
   |
49 | /     if path.is_absolute() != base.is_absolute() {
50 | |         if path.is_absolute() {
51 | |             Some(PathBuf::from(path))
52 | |         } else {
...  |
82 | |         Some(comps.iter().map(|c| c.as_os_str()).collect())
83 | |     }
   | |_____^
   |
   = 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 21 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:21:5
   |
21 | 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
  = note: `-W clippy::doc-markdown` implied by `-W clippy::pedantic`
  = help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_markdown)]`

Check warning on line 36 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:36:29
   |
36 |                 .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 23 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:23:19
   |
23 |         } 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
   = note: `-W clippy::case-sensitive-file-extension-comparisons` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::case_sensitive_file_extension_comparisons)]`
help: use std::path::Path
   |
23 ~         } else if std::path::Path::new(str)
24 +             .extension()
25 ~             .map_or(false, |ext| ext.eq_ignore_ascii_case("zip")) || str.ends_with(".mrpack") {
   |

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 20 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:20:9
   |
20 |         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 14 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(data.iter().copied().filter(|&e| e != 9 && e != 10 && e != 13 && e != 32))
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `self.0.extend(data.iter().copied().filter(|&e| e != 9 && e != 10 && e != 13 && e != 32));`
   |
   = 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)]`