impl github, fmt #211
clippy
19 errors, 113 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 19 |
Warning | 113 |
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
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 65 in src/api/models/packwiz/mod.rs
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
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
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
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
Check warning on line 10 in src/api/app/actions/build/mod.rs
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 | | Ok(())
10 | | }
| |_____^
|
= 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 72 in src/api/utils/pathdiff.rs
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
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
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
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
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
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
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
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
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
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
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
= 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
|
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 57 in src/api/sources/vanilla/mod.rs
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 20 in src/api/sources/vanilla/mod.rs
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:20:22
|
20 | 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
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
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
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
= note: `-W clippy::doc-markdown` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::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
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 25 in src/api/sources/url/mod.rs
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/url/mod.rs:25:14
|
25 | 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 30 in src/api/sources/modrinth/mod.rs
github-actions / clippy
question mark operator is useless here
error: question mark operator is useless here
--> src/api/sources/modrinth/mod.rs:30:9
|
30 | 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