more stuff #206
clippy
9 errors, 59 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 9 |
Warning | 59 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.78.0 (9b00956e5 2024-04-29)
- cargo 1.78.0 (54d8815d0 2024-03-26)
- clippy 0.1.78 (9b00956 2024-04-29)
Annotations
Check warning on line 18 in src/commands/init.rs
github-actions / clippy
unused `async` for function with no await statements
warning: unused `async` for function with no await statements
--> src/commands/init.rs:14:1
|
14 | / pub async fn run(mut app: App, args: Args) -> Result<()> {
15 | |
16 | |
17 | | Ok(())
18 | | }
| |_^
|
= 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 33 in src/api/sources/mod.rs
github-actions / clippy
unused `async` for function with no await statements
warning: unused `async` for function with no await statements
--> src/api/sources/mod.rs:9:1
|
9 | / pub async fn resolve_steps_for_url(
10 | | app: &App,
11 | | url: impl Into<String>,
12 | | filename: Option<String>,
... |
32 | | ])
33 | | }
| |_^
|
= 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 27 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:18:5
|
18 | / pub async fn dir(&self) -> Result<Vec<String>> {
19 | | match self {
20 | | Accessor::Zip(zip) => Ok(zip.file_names().map(ToOwned::to_owned).collect()),
21 | | Accessor::Local(path) => Ok(path.read_dir()?
... |
26 | | }
27 | | }
| |_____^
|
= 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: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
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 26 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:24:5
|
24 | / pub async fn into_addon(&self) -> Result<Addon> {
25 | | todo!()
26 | | }
| |_____^
|
= 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 21 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:14:1
|
14 | / pub async fn resolve_mrpack_addons(
15 | | app: &App,
16 | | accessor: Accessor,
17 | | ) -> Result<Vec<Addon>> {
... |
20 | | todo!()
21 | | }
| |_^
|
= 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 13 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:11:5
|
11 | / pub async fn into_addon(&self) -> Result<Addon> {
12 | | todo!()
13 | | }
| |_____^
|
= 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/models/addon/addon.rs
github-actions / clippy
unused `async` for function with no await statements
warning: unused `async` for function with no await statements
--> src/api/models/addon/addon.rs:23:5
|
23 | / async fn resolve_steps(&self) -> Result<Vec<Step>> {
24 | | Ok(vec![])
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 39 in src/api/models/source.rs
github-actions / clippy
unused `async` for function with no await statements
warning: unused `async` for function with no await statements
--> src/api/models/source.rs:25:5
|
25 | / pub async fn resolve(&self, app: &App) -> Result<Vec<Addon>> {
26 | | match self {
27 | | Source::File { path } => {
28 | | Ok(vec![])
... |
38 | | }
39 | | }
| |_____^
|
= 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 46 in src/api/models/step.rs
github-actions / clippy
unused `async` for function with no await statements
warning: unused `async` for function with no await statements
--> src/api/models/step.rs:44:5
|
44 | / async fn run(&self) -> Result<StepResult> {
45 | | Ok(StepResult::Continue)
46 | | }
| |_____^
|
= 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 27 in src/api/sources/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/mod.rs:27:18
|
27 | 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 warning on line 22 in src/api/utils/accessor.rs
github-actions / clippy
redundant closure
warning: redundant closure
--> src/api/utils/accessor.rs:22:29
|
22 | .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 failure on line 60 in src/api/app/mod.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/api/app/mod.rs:60:51
|
60 | addons.append(&mut source.resolve(&self).await?);
| ^^^^^ help: change this to: `self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `-D clippy::needless-borrow` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::needless_borrow)]`
Check warning on line 30 in src/api/models/server/server_flavor.rs
github-actions / clippy
this match arm has an identical body to another arm
warning: this match arm has an identical body to another arm
--> src/api/models/server/server_flavor.rs:30:13
|
30 | ServerFlavor::Patched => true,
| ---------------------^^^^^^^^
| |
| help: try merging the arm patterns: `ServerFlavor::Patched | ServerFlavor::Proxy`
|
= help: or try changing either arm body
note: other arm here
--> src/api/models/server/server_flavor.rs:31:13
|
31 | ServerFlavor::Proxy => true,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
Check warning on line 29 in src/api/models/server/server_flavor.rs
github-actions / clippy
this match arm has an identical body to another arm
warning: this match arm has an identical body to another arm
--> src/api/models/server/server_flavor.rs:29:13
|
29 | ServerFlavor::Modded => false,
| --------------------^^^^^^^^^
| |
| help: try merging the arm patterns: `ServerFlavor::Modded | ServerFlavor::Vanilla`
|
= help: or try changing either arm body
note: other arm here
--> src/api/models/server/server_flavor.rs:28:13
|
28 | ServerFlavor::Vanilla => false,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
Check warning on line 26 in src/api/models/server/server_flavor.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/models/server/server_flavor.rs:26:29
|
26 | pub fn supports_plugins(&self) -> bool {
| ^^^^^ 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 failure on line 23 in src/api/models/server/server_flavor.rs
github-actions / clippy
match expression looks like `matches!` macro
error: match expression looks like `matches!` macro
--> src/api/models/server/server_flavor.rs:20:9
|
20 | / match self {
21 | | ServerFlavor::Modded => true,
22 | | _ => false,
23 | | }
| |_________^ help: try: `matches!(self, ServerFlavor::Modded)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
Check warning on line 19 in src/api/models/server/server_flavor.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/models/server/server_flavor.rs:19:26
|
19 | pub fn supports_mods(&self) -> bool {
| ^^^^^ 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 failure on line 16 in src/api/models/server/server_flavor.rs
github-actions / clippy
match expression looks like `matches!` macro
error: match expression looks like `matches!` macro
--> src/api/models/server/server_flavor.rs:13:9
|
13 | / match self {
14 | | ServerFlavor::Proxy => false,
15 | | _ => true,
16 | | }
| |_________^ help: try: `!matches!(self, ServerFlavor::Proxy)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
= note: `-D clippy::match-like-matches-macro` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::match_like_matches_macro)]`
Check warning on line 12 in src/api/models/server/server_flavor.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/models/server/server_flavor.rs:12:31
|
12 | pub fn supports_datapacks(&self) -> bool {
| ^^^^^ 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
= note: `-W clippy::trivially-copy-pass-by-ref` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::trivially_copy_pass_by_ref)]`
Check warning on line 2 in src/api/models/server/server_type.rs
github-actions / clippy
usage of wildcard import
warning: usage of wildcard import
--> src/api/models/server/server_type.rs:2:5
|
2 | use crate::api::utils::serde::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::api::utils::serde::str_latest`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports
= note: `-W clippy::wildcard-imports` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::wildcard_imports)]`
Check failure on line 24 in src/api/models/mrpack/mod.rs
github-actions / clippy
methods called `into_*` usually take `self` by value
error: methods called `into_*` usually take `self` by value
--> src/api/models/mrpack/mod.rs:24:29
|
24 | pub async fn into_addon(&self) -> Result<Addon> {
| ^^^^^
|
= 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 failure on line 11 in src/api/models/packwiz/mod.rs
github-actions / clippy
methods called `into_*` usually take `self` by value
error: methods called `into_*` usually take `self` by value
--> src/api/models/packwiz/mod.rs:11:29
|
11 | pub async fn into_addon(&self) -> Result<Addon> {
| ^^^^^
|
= 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
= note: `-D clippy::wrong-self-convention` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::wrong_self_convention)]`
Check warning on line 18 in src/api/models/addon/addon.rs
github-actions / clippy
field name starts with the struct's name
warning: field name starts with the struct's name
--> src/api/models/addon/addon.rs:18:5
|
18 | pub addon_type: AddonType,
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#struct_field_names
= note: `-W clippy::struct-field-names` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::struct_field_names)]`