Skip to content

sources for network.toml

Sign in for the full log view
GitHub Actions / clippy failed Jul 25, 2024 in 3s

clippy

55 errors, 190 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 55
Warning 190
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 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 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 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 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 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 736 bytes
30 | |   }
   | |___^ the entire enum is at least 736 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
  |     ~~~~~~~~~~~

Check warning on line 7 in src/api/utils/logger/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function's return value is unnecessary

warning: this function's return value is unnecessary
 --> src/api/utils/logger/mod.rs:3:1
  |
3 | / pub fn init_logger() -> Result<()> {
4 | |     env_logger::init();
5 | |
6 | |     Ok(())
7 | | }
  | |_^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
  = note: `-W clippy::unnecessary-wraps` implied by `-W clippy::pedantic`
  = help: to override `-W clippy::pedantic` add `#[allow(clippy::unnecessary_wraps)]`
help: remove the return type...
  |
3 | pub fn init_logger() -> Result<()> {
  |                         ~~~~~~~~~~
help: ...and then remove returned values
  |
6 -     Ok(())
6 +     
  |