Skip to content

this should build

this should build #248

GitHub Actions / clippy failed Aug 4, 2024 in 2s

clippy

61 errors, 165 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 61
Warning 165
Note 0
Help 0

Versions

  • rustc 1.80.0 (051478957 2024-07-21)
  • cargo 1.80.0 (376290515 2024-07-16)
  • clippy 0.1.80 (0514789 2024-07-21)

Annotations

Check warning on line 125 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")?;
...   |
124 | |     Ok(())
125 | | }
    | |_^
    |
    = 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 88 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:84:5
   |
84 | /     pub async fn handle_event(self: Arc<Self>, event: MsgIn) -> Result<()> {
85 | |         
86 | |         
87 | |         Ok(())
88 | |     }
   | |_____^
   |
   = 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 68 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:45:1
   |
45 | / pub async fn zip<T: Write + Seek>(writer: T, folder: &Path) -> Result<()> {
46 | |     let mut archive = ZipWriter::new(writer);
47 | |
48 | |     archive.set_comment(format!("generated by mcman/{APP_VERSION}"));
...  |
67 | |     Ok(())
68 | | }
   | |_^
   |
   = 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 42 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:12:1
   |
12 | / pub async fn unzip<T: Read + Seek>(reader: T, to: &Path, prefix: Option<String>) -> Result<()> {
13 | |     let mut archive = ZipArchive::new(reader)?;
14 | |
15 | |     let mut files = archive.file_names().map(ToOwned::to_owned).collect::<Vec<_>>();
...  |
41 | |     Ok(())
42 | | }
   | |_^
   |
   = 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 52 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:42:5
   |
42 | /     pub async fn dir(&self) -> Result<Vec<String>> {
43 | |         match self {
44 | |             Accessor::ZipLocal(zip) => Ok(zip.file_names().map(ToOwned::to_owned).collect()),
45 | |             Accessor::Local(path) => Ok(path
...  |
51 | |         }
52 | |     }
   | |_____^
   |
   = 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 93 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:54:1
   |
54 | / pub async fn resolve_compile_steps(
55 | |     _app: &App,
56 | |     jar_name: &str,
57 | |     craftbukkit: bool,
...  |
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 36 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:29:1
   |
29 | / pub async fn resolve_remove_steps(
30 | |     _app: &App,
31 | |     _craftbukkit: bool,
32 | |     _custom_args: &Vec<String>,
...  |
35 | |     Ok(vec![Step::RemoveFile(FileMeta::filename(String::from("server.jar")))])
36 | | }
   | |_^
   |
   = 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 75 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:71:5
   |
71 | /     pub async fn resolve_remove_steps(&self, id: &str, version: &str) -> Result<Vec<Step>> {
72 | |         Ok(vec![
73 | |             Step::RemoveFile(FileMeta::filename(format!("spigot-{}-{}.jar", resource_id(id), version)))
74 | |         ])
75 | |     }
   | |_____^
   |
   = 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 117 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(
84  | |         &self,
85  | |         url: &str,
86  | |         group_id: &str,
...   |
116 | |         Ok((download_url, metadata))
117 | |     }
    | |_____^
    |
    = 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 102 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:72:5
    |
72  | /     pub async fn into_addon(&self, app: &App, target: AddonTarget) -> Result<Addon> {
73  | |         let addon_type = if let Some(update) = &self.update {
74  | |             match update {
75  | |                 PackwizModUpdate::Modrinth { mod_id, version } => AddonType::Modrinth {
...   |
101 | |         Ok(addon)
102 | |     }
    | |_____^
    |
    = 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 53 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:51:5
   |
51 | /     pub async fn from_steps(steps: &Vec<Step>) -> Self {
52 | |         todo!()
53 | |     }
   | |_____^
   |
   = 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/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:35:5
   |
35 | /     pub async fn into_addon(&self) -> Result<Addon> {
36 | |         Ok(Addon {
37 | |             environment: self.env.as_ref().map(|e| e.clone().into()),
38 | |             addon_type: AddonType::Url {
...  |
46 | |         })
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 83 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:66:5
   |
66 | /     pub async fn should_bootstrap_file(&self, file: &Path) -> bool {
67 | |         let ext = file.extension().unwrap_or_default().to_str().unwrap_or_default();
68 | |
69 | |         let bootstrap_exts = [
...  |
82 | |         bootstrap_exts.contains(&ext)
83 | |     }
   | |_____^
   |
   = 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 120 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:120:26
    |
120 |         .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 warning on line 71 in src/commands/init.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `map(<f>).unwrap_or_else(<g>)` on an `Option` value

warning: called `map(<f>).unwrap_or_else(<g>)` on an `Option` value
  --> src/commands/init.rs:71:24
   |
71 |     let name: String = args.name.map(Ok).unwrap_or_else(|| cliclack::input("Name of the network?").interact())?;
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `args.name.map_or_else(|| cliclack::input("Name of the network?").interact(), Ok)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or

Check warning on line 46 in src/commands/init.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `map(<f>).unwrap_or_else(<g>)` on an `Option` value

warning: called `map(<f>).unwrap_or_else(<g>)` on an `Option` value
  --> src/commands/init.rs:46:24
   |
46 |     let name: String = args.name.map(Ok).unwrap_or_else(|| cliclack::input("Name of the server?").interact())?;
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `args.name.map_or_else(|| cliclack::input("Name of the server?").interact(), Ok)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or

Check failure on line 72 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:72:20
   |
72 |             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 760 bytes
30 | |   }
   | |___^ the entire enum is at least 760 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 warning on line 1 in src/api/ws/mod.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/ws/mod.rs:1:5
  |
1 | //! WebSocket Server implementation for third party editors
  |     ^^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
  |
1 | //! `WebSocket` Server implementation for third party editors
  |     ~~~~~~~~~~~