Skip to content
GitHub Actions / clippy failed Jul 17, 2024 in 2s

clippy

54 errors, 179 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 54
Warning 179
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 124 in src/commands/migrate.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/migrate.rs:38:1
    |
38  | / pub async fn migrate_server() -> Result<()> {
39  | |     let legacy_server = read_toml::<LegacyServer>(&PathBuf::from("./server.toml"))
40  | |         .with_context(|| "Reading server.toml")?;
...   |
123 | |     Ok(())
124 | | }
    | |_^
    |
    = 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 14 in src/commands/markdown/print.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/markdown/print.rs:10:1
   |
10 | / pub async fn run(app: Arc<App>, args: Args) -> Result<()> {
11 | |     todo!();
12 | |
13 | |     Ok(())
14 | | }
   | |_^
   |
   = 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 86 in src/api/ws/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/ws/mod.rs:82:5
   |
82 | /     pub async fn handle_event(self: Arc<Self>, event: MsgIn) -> Result<()> {
83 | |         
84 | |         
85 | |         Ok(())
86 | |     }
   | |_____^
   |
   = 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 66 in src/api/utils/zip.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/zip.rs:43:1
   |
43 | / pub async fn zip<T: Write + Seek>(writer: T, folder: &Path) -> Result<()> {
44 | |     let mut archive = ZipWriter::new(writer);
45 | |
46 | |     archive.set_comment(format!("generated by mcman/{APP_VERSION}"));
...  |
65 | |     Ok(())
66 | | }
   | |_^
   |
   = 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 41 in src/api/utils/zip.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/zip.rs:11:1
   |
11 | / pub async fn unzip<T: Read + Seek>(reader: T, to: &Path, prefix: Option<String>) -> Result<()> {
12 | |     let mut archive = ZipArchive::new(reader)?;
13 | |
14 | |     let mut files = archive.file_names().map(ToOwned::to_owned).collect::<Vec<_>>();
...  |
40 | |     Ok(())
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 55 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:45:5
   |
45 | /     pub async fn dir(&self) -> Result<Vec<String>> {
46 | |         match self {
47 | |             Accessor::ZipLocal(zip) => Ok(zip.file_names().map(ToOwned::to_owned).collect()),
48 | |             Accessor::Local(path) => Ok(path
...  |
54 | |         }
55 | |     }
   | |_____^
   |
   = 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 93 in src/api/sources/quilt/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/quilt/mod.rs:59:5
   |
59 | /     pub async fn resolve_steps_build(
60 | |         &self,
61 | |         jar_name: &str,
62 | |         mc_version: &str,
...  |
92 | |         ])
93 | |     }
   | |_____^
   |
   = 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 79 in src/api/sources/buildtools/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/buildtools/mod.rs:40:1
   |
40 | / pub async fn resolve_steps_build(
41 | |     _app: &App,
42 | |     jar_name: &str,
43 | |     craftbukkit: bool,
...  |
78 | |     ])
79 | | }
   | |_^
   |
   = 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 69 in src/api/sources/spigot/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/spigot/mod.rs:51:5
   |
51 | /     pub async fn resolve_steps(&self, id: &str, version: &str) -> Result<Vec<Step>> {
52 | |         let url = format!(
53 | |             "{}/resources/{}/versions/{}/download/proxy",
54 | |             self.0.options.api_urls.spiget,
...  |
68 | |         ])
69 | |     }
   | |_____^
   |
   = 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/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,
...  |
64 | |         Ok(steps)
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 120 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:83:5
    |
83  | /     pub async fn resolve_steps(
84  | |         &self,
85  | |         url: &str,
86  | |         group_id: &str,
...   |
119 | |         ])
120 | |     }
    | |_____^
    |
    = 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 96 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:66:5
   |
66 | /     pub async fn into_addon(&self, app: &App, target: AddonTarget) -> Result<Addon> {
67 | |         let addon_type = if let Some(update) = &self.update {
68 | |             match update {
69 | |                 PackwizModUpdate::Modrinth { mod_id, version } => AddonType::Modrinth {
...  |
95 | |         Ok(addon)
96 | |     }
   | |_____^
   |
   = 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 47 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:45:5
   |
45 | /     pub async fn from_steps(steps: &Vec<Step>) -> Self {
46 | |         todo!()
47 | |     }
   | |_____^
   |
   = 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 56 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:46:5
   |
46 | /     pub async fn action_init_network(&self) -> Result<()> {
47 | |         cliclack::intro("initializing network")?;
48 | |
49 | |         let name: String = cliclack::input("Name of the network?").interact()?;
...  |
55 | |         Ok(())
56 | |     }
   | |_____^
   |
   = 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 78 in src/api/app/actions/build/bootstrap.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/bootstrap.rs:61:5
   |
61 | /     pub async fn should_bootstrap_file(&self, file: &Path) -> bool {
62 | |         let ext = file.extension().unwrap_or_default().to_str().unwrap_or_default();
63 | |
64 | |         let bootstrap_exts = [
...  |
77 | |         bootstrap_exts.contains(&ext)
78 | |     }
   | |_____^
   |
   = 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 21 in src/api/sources/buildtools/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless use of `vec!`

error: useless use of `vec!`
  --> src/api/sources/buildtools/mod.rs:21:8
   |
21 |     Ok(vec![jar, exec].concat())
   |        ^^^^^^^^^^^^^^^ help: you can use an array directly: `[jar, exec]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
   = note: `-D clippy::useless-vec` implied by `-D clippy::all`
   = help: to override `-D clippy::all` add `#[allow(clippy::useless_vec)]`

Check failure on line 119 in src/commands/migrate.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless use of `format!`

error: useless use of `format!`
   --> src/commands/migrate.rs:119:26
    |
119 |         .with_context(|| format!("Writing server.toml"))?;
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Writing server.toml".to_string()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format

Check failure on line 72 in src/commands/migrate.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless use of `format!`

error: useless use of `format!`
  --> src/commands/migrate.rs:72:26
   |
72 |         .with_context(|| format!("Writing addons.toml"))?;
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Writing addons.toml".to_string()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format

Check failure on line 70 in src/api/ws/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant pattern matching, consider using `is_err()`

error: redundant pattern matching, consider using `is_err()`
  --> src/api/ws/mod.rs:70:20
   |
70 |             if let Err(_) = client.send(msg.clone()).await {
   |             -------^^^^^^--------------------------------- help: try: `if (client.send(msg.clone()).await).is_err()`
   |
   = note: this will change drop order of the result, as well as all temporaries
   = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
   = note: `-D clippy::redundant-pattern-matching` implied by `-D clippy::all`
   = help: to override `-D clippy::all` add `#[allow(clippy::redundant_pattern_matching)]`

Check failure on line 32 in src/api/ws/msg.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/api/ws/msg.rs:32:1
   |
32 | impl Into<Message> for MsgOut {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = 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<api::ws::msg::MsgOut>`
   |
32 ~ impl From<MsgOut> for Message {
33 ~     fn from(val: MsgOut) -> Self {
34 ~         Message::text(serde_json::to_string(&val).unwrap())
   |

Check failure on line 30 in src/api/ws/msg.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

large size difference between variants

error: large size difference between variants
  --> src/api/ws/msg.rs:21:1
   |
21 | /   pub enum MsgOut {
22 | | /     Connected {
23 | | |         version: String,
24 | | |     },
   | | |_____- the second-largest variant contains at least 24 bytes
25 | |
26 | | /     AppInfo {
27 | | |         server: Option<Server>,
28 | | |         network: Option<Network>,
29 | | |     },
   | | |_____- the largest variant contains at least 640 bytes
30 | |   }
   | |___^ the entire enum is at least 640 bytes
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
   = note: `-D clippy::large-enum-variant` implied by `-D clippy::all`
   = help: to override `-D clippy::all` add `#[allow(clippy::large_enum_variant)]`
help: consider boxing the large fields to reduce the total size of the enum
   |
27 |         server: Box<Option<Server>>,
   |                 ~~~~~~~~~~~~~~~~~~~

Check failure on line 27 in src/api/utils/toml.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/toml.rs:27:59
   |
27 |     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 warning on line 20 in src/api/utils/zip.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/zip.rs:18:13
   |
18 | /             files = files.into_iter()
19 | |                 .map(|f| f.replacen(&prefix, "", 1))
20 | |                 .collect()
   | |__________________________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a `;` here
   |
18 ~             files = files.into_iter()
19 +                 .map(|f| f.replacen(&prefix, "", 1))
20 +                 .collect();
   |

Check warning on line 45 in src/api/utils/script.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/script.rs:45:24
   |
45 |     pub fn script_args(&self) -> &'static str {
   |                        ^^^^^ 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