refactor: let clippy do its job #255
Annotations
33 errors and 48 warnings
redundant pattern matching, consider using `is_err()`:
src/api/ws/mod.rs#L79
error: redundant pattern matching, consider using `is_err()`
--> src/api/ws/mod.rs:79:20
|
79 | 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)]`
|
large size difference between variants:
src/api/ws/msg.rs#L21
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>>,
| ~~~~~~~~~~~~~~~~~~~
|
redundant guard:
src/api/utils/pathdiff.rs#L93
error: redundant guard
--> src/api/utils/pathdiff.rs:93:39
|
93 | (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
|
93 - (Some(_), Some(b)) if b == Component::ParentDir => return None,
93 + (Some(_), Some(Component::ParentDir)) => return None,
|
|
redundant guard:
src/api/utils/pathdiff.rs#L92
error: redundant guard
--> src/api/utils/pathdiff.rs:92:39
|
92 | (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
|
92 - (Some(a), Some(b)) if b == Component::CurDir => comps.push(a),
92 + (Some(a), Some(Component::CurDir)) => comps.push(a),
|
|
direct implementation of `ToString`:
src/api/utils/accessor.rs#L18
error: direct implementation of `ToString`
--> src/api/utils/accessor.rs:18:1
|
18 | / impl ToString for Accessor {
19 | | fn to_string(&self) -> String {
20 | | match self {
21 | | Accessor::Local(path) => path.to_string_lossy().into_owned(),
... |
25 | | }
26 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
|
current MSRV (Minimum Supported Rust Version) is `1.75.0` but this item is stable since `1.80.0`:
src/api/tools/git/mod.rs#L7
error: current MSRV (Minimum Supported Rust Version) is `1.75.0` but this item is stable since `1.80.0`
--> src/api/tools/git/mod.rs:7:48
|
7 | static GIT_VERSION: LazyLock<Option<String>> = LazyLock::new(version_check);
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
= note: `-D clippy::incompatible-msrv` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::incompatible_msrv)]`
|
methods called `into_*` usually take `self` by value:
src/api/sources/vanilla/mod.rs#L20
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
|
empty doc comment:
src/api/sources/hangar/models.rs#L268
error: empty doc comment
--> src/api/sources/hangar/models.rs:268:1
|
268 | ///
| ^^^
|
= help: consider removing or filling it
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs
= note: `-D clippy::empty-docs` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::empty_docs)]`
|
direct implementation of `ToString`:
src/api/sources/hangar/models.rs#L180
error: direct implementation of `ToString`
--> src/api/sources/hangar/models.rs:180:1
|
180 | / impl ToString for Platform {
181 | | fn to_string(&self) -> String {
182 | | match self {
183 | | Self::Paper => "PAPER".to_owned(),
... |
187 | | }
188 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
|
direct implementation of `ToString`:
src/api/sources/hangar/models.rs#L12
error: direct implementation of `ToString`
--> src/api/sources/hangar/models.rs:12:1
|
12 | / impl ToString for Namespace {
13 | | fn to_string(&self) -> String {
14 | | format!("{}/{}", self.owner, self.slug)
15 | | }
16 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
|
struct update has no effect, all the fields in the struct have already been specified:
src/api/sources/curseforge/mod.rs#L95
error: struct update has no effect, all the fields in the struct have already been specified
--> src/api/sources/curseforge/mod.rs:95:15
|
95 | ..Default::default()
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update
|
struct update has no effect, all the fields in the struct have already been specified:
src/api/sources/curseforge/mod.rs#L72
error: struct update has no effect, all the fields in the struct have already been specified
--> src/api/sources/curseforge/mod.rs:72:15
|
72 | ..Default::default()
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update
= note: `-D clippy::needless-update` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::needless_update)]`
|
writing `&Vec` instead of `&[_]` involves a new object where a slice will do:
src/api/sources/buildtools/mod.rs#L69
error: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/api/sources/buildtools/mod.rs:69:18
|
69 | custom_args: &Vec<String>,
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
help: change this to
|
69 ~ custom_args: &[String],
70 | mc_version: &str,
...
86 |
87 ~ args.extend(custom_args.to_owned());
|
|
writing `&Vec` instead of `&[_]` involves a new object where a slice will do:
src/api/sources/buildtools/mod.rs#L43
error: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/api/sources/buildtools/mod.rs:43:19
|
43 | _custom_args: &Vec<String>,
| ^^^^^^^^^^^^ help: change this to: `&[String]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
|
direct implementation of `ToString`:
src/api/models/server/server_type.rs#L28
error: direct implementation of `ToString`
--> src/api/models/server/server_type.rs:28:1
|
28 | / impl ToString for PaperMCProject {
29 | | fn to_string(&self) -> String {
30 | | match self {
31 | | Self::Paper => "paper".to_owned(),
... |
35 | | }
36 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
|
match expression looks like `matches!` macro:
src/api/models/server/server_flavor.rs#L46
error: match expression looks like `matches!` macro
--> src/api/models/server/server_flavor.rs:46:9
|
46 | / match self {
47 | | ServerFlavor::Patched => true,
48 | | _ => false,
49 | | }
| |_________^ help: try: `matches!(self, ServerFlavor::Patched)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
|
match expression looks like `matches!` macro:
src/api/models/server/server_flavor.rs#L39
error: match expression looks like `matches!` macro
--> src/api/models/server/server_flavor.rs:39:9
|
39 | / match self {
40 | | ServerFlavor::Proxy => false,
41 | | _ => true,
42 | | }
| |_________^ 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
|
match expression looks like `matches!` macro:
src/api/models/server/server_flavor.rs#L23
error: match expression looks like `matches!` macro
--> src/api/models/server/server_flavor.rs:23:9
|
23 | / match self {
24 | | ServerFlavor::Modded => true,
25 | | _ => false,
26 | | }
| |_________^ 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
|
match expression looks like `matches!` macro:
src/api/models/server/server_flavor.rs#L16
error: match expression looks like `matches!` macro
--> src/api/models/server/server_flavor.rs:16:9
|
16 | / match self {
17 | | ServerFlavor::Proxy => false,
18 | | _ => true,
19 | | }
| |_________^ 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)]`
|
methods called `into_*` usually take `self` by value:
src/api/models/packwiz/mod.rs#L78
error: methods called `into_*` usually take `self` by value
--> src/api/models/packwiz/mod.rs:78:29
|
78 | pub async fn into_addon(&self, app: &App, target: AddonTarget) -> 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
|
writing `&Vec` instead of `&[_]` involves a new object where a slice will do:
src/api/models/packwiz/mod.rs#L57
error: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/api/models/packwiz/mod.rs:57:36
|
57 | pub async fn from_steps(steps: &Vec<Step>) -> Self {
| ^^^^^^^^^^ help: change this to: `&[Step]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `-D clippy::ptr-arg` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::ptr_arg)]`
|
methods called `into_*` usually take `self` by value:
src/api/models/mrpack/mod.rs#L34
error: methods called `into_*` usually take `self` by value
--> src/api/models/mrpack/mod.rs:34:29
|
34 | 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
|
methods called `into_*` usually take `self` by value:
src/api/models/metadata/addon_metadata.rs#L46
error: methods called `into_*` usually take `self` by value
--> src/api/models/metadata/addon_metadata.rs:46:21
|
46 | pub fn into_str(&self) -> &'static str {
| ^^^^^
|
= 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)]`
|
direct implementation of `ToString`:
src/api/models/markdown/mod.rs#L64
error: direct implementation of `ToString`
--> src/api/models/markdown/mod.rs:64:1
|
64 | / impl ToString for MdColumn {
65 | | fn to_string(&self) -> String {
66 | | match self {
67 | | MdColumn::Icon => String::from("."),
... |
73 | | }
74 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
|
name `HTML` contains a capitalized acronym:
src/api/models/markdown/mod.rs#L14
error: name `HTML` contains a capitalized acronym
--> src/api/models/markdown/mod.rs:14:5
|
14 | HTML,
| ^^^^ help: consider making the acronym lowercase, except the initial letter: `Html`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
|
name `ASCII` contains a capitalized acronym:
src/api/models/markdown/mod.rs#L13
error: name `ASCII` contains a capitalized acronym
--> src/api/models/markdown/mod.rs:13:5
|
13 | ASCII,
| ^^^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Ascii`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
= note: `-D clippy::upper-case-acronyms` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::upper_case_acronyms)]`
|
direct implementation of `ToString`:
src/api/models/addon/addon_type.rs#L61
error: direct implementation of `ToString`
--> src/api/models/addon/addon_type.rs:61:1
|
61 | / impl ToString for AddonType {
62 | | fn to_string(&self) -> String {
63 | | match self {
64 | | AddonType::Url { url } => format!("Url [{url}]"),
... |
88 | | }
89 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
|
module has the same name as its containing module:
src/api/models/addon/mod.rs#L1
error: module has the same name as its containing module
--> src/api/models/addon/mod.rs:1:1
|
1 | mod addon;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
= note: `-D clippy::module-inception` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::module_inception)]`
|
direct implementation of `ToString`:
src/api/models/modpack_type.rs#L12
error: direct implementation of `ToString`
--> src/api/models/modpack_type.rs:12:1
|
12 | / impl ToString for ModpackType {
13 | | fn to_string(&self) -> String {
14 | | match self {
15 | | ModpackType::Packwiz => String::from("Packwiz"),
... |
19 | | }
20 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
|
direct implementation of `ToString`:
src/api/models/env.rs#L16
error: direct implementation of `ToString`
--> src/api/models/env.rs:16:1
|
16 | / impl ToString for Environment {
17 | | fn to_string(&self) -> String {
18 | | match self {
19 | | Environment::Both => String::from("both"),
... |
23 | | }
24 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
= note: `-D clippy::to-string-trait-impl` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::to_string_trait_impl)]`
|
lint group `pedantic` has the same priority (0) as a lint:
Cargo.toml#L24
error: lint group `pedantic` has the same priority (0) as a lint
--> Cargo.toml:24:1
|
24 | pedantic = "warn"
| ^^^^^^^^ ------ has an implicit priority of 0
...
28 | struct_excessive_bools = "allow"
| ---------------------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
help: to have lints override the group set `pedantic` to a lower priority
|
24 | pedantic = { level = "warn", priority = -1 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
lint group `all` has the same priority (0) as a lint:
Cargo.toml#L23
error: lint group `all` has the same priority (0) as a lint
--> Cargo.toml:23:1
|
23 | all = "deny"
| ^^^ ------ has an implicit priority of 0
...
28 | struct_excessive_bools = "allow"
| ---------------------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
= note: `-D clippy::lint-groups-priority` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::lint_groups_priority)]`
help: to have lints override the group set `all` to a lower priority
|
23 | all = { level = "deny", priority = -1 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
clippy
Clippy had exited with the 101 exit code
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/utils/serde.rs#L41
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/utils/serde.rs:41:19
|
41 | pub fn is_true(b: &bool) -> bool {
| ^^^^^ help: consider passing by value instead: `bool`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref
|
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#L45
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
|
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#L38
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:38:21
|
38 | pub fn line_sep(&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
|
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#L31
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:31:21
|
31 | pub fn file_ext(&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
|
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#L24
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:24:19
|
24 | pub fn header(&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
|
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#L17
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:17:20
|
17 | pub fn comment(&self, comment: &str) -> String {
| ^^^^^ 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
|
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#L8
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:8:28
|
8 | pub fn generate_script(&self, lines: Vec<String>) -> String {
| ^^^^^ 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
|
this argument is passed by value, but not consumed in the function body:
src/api/utils/script.rs#L8
warning: this argument is passed by value, but not consumed in the function body
--> src/api/utils/script.rs:8:42
|
8 | pub fn generate_script(&self, lines: Vec<String>) -> String {
| ^^^^^^^^^^^ help: consider changing the type to: `&[String]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
|
unnecessary `!=` operation:
src/api/utils/pathdiff.rs#L72
warning: unnecessary `!=` operation
--> src/api/utils/pathdiff.rs:72:5
|
72 | / if path.is_absolute() != base.is_absolute() {
73 | | if path.is_absolute() {
74 | | Some(PathBuf::from(path))
75 | | } else {
... |
105 | | Some(comps.iter().map(|c| c.as_os_str()).collect())
106 | | }
| |_____^
|
= 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
|
this argument is passed by value, but not consumed in the function body:
src/api/utils/markdown/mod.rs#L100
warning: this argument is passed by value, but not consumed in the function body
--> src/api/utils/markdown/mod.rs:100:45
|
100 | fn wrap(tag: &'static str, content: String) -> String {
| ^^^^^^ help: consider changing the type to: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
|
this function's return value is unnecessary:
src/api/utils/logger/mod.rs#L3
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(())
|
|
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#L25
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 + Send> {
| ^^^^^ 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
|
case-sensitive file extension comparison:
src/api/utils/accessor.rs#L32
warning: case-sensitive file extension comparison
--> src/api/utils/accessor.rs:32:19
|
32 | } 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
|
32 ~ } else if std::path::Path::new(str)
33 + .extension()
34 ~ .map_or(false, |ext| ext.eq_ignore_ascii_case("zip")) || str.ends_with(".mrpack") {
|
|
this match arm has an identical body to another arm:
src/api/utils/accessor.rs#L23
warning: this match arm has an identical body to another arm
--> src/api/utils/accessor.rs:23:13
|
23 | Accessor::ZipLocal((path, _)) => path.to_string_lossy().into_owned(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try changing either arm body
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
help: or try merging the arm patterns
|
23 | Accessor::ZipLocal((path, _)) | Accessor::Local(path) => path.to_string_lossy().into_owned(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: and remove this obsolete arm
|
21 - Accessor::Local(path) => path.to_string_lossy().into_owned(),
|
|
this match arm has an identical body to another arm:
src/api/tools/java/installation.rs#L23
warning: this match arm has an identical body to another arm
--> src/api/tools/java/installation.rs:23:13
|
23 | (Some("1"), Some(ver)) => ver,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try changing either arm body
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
help: or try merging the arm patterns
|
23 | (Some("1"), Some(ver)) | (Some(ver), _) => ver,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: and remove this obsolete arm
|
24 - (Some(ver), _) => ver,
|
|
unnecessary `!=` operation:
src/api/tools/java/check.rs#L10
warning: unnecessary `!=` operation
--> src/api/tools/java/check.rs:10:16
|
10 | let path = if path.file_name()?.to_str()? != JAVA_BIN {
| ________________^
11 | | path.join(JAVA_BIN)
12 | | } else {
13 | | path.clone()
14 | | };
| |_____^
|
= 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)]`
|
wildcard matches only a single variant and will also match any future added variants:
src/api/sources/vanilla/mod.rs#L57
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
|
possible intra-doc link using quotes instead of backticks:
src/api/sources/vanilla/version.rs#L87
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)]`
|
wildcard matches only a single variant and will also match any future added variants:
src/api/sources/quilt/mod.rs#L95
warning: wildcard matches only a single variant and will also match any future added variants
--> src/api/sources/quilt/mod.rs:95:13
|
95 | _ => {},
| ^ 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)]`
|
all fields have the same postfix: `url`:
src/api/sources/curseforge/models.rs#L26
warning: all fields have the same postfix: `url`
--> src/api/sources/curseforge/models.rs:26:1
|
26 | / pub struct CurseforgeModLinks {
27 | | pub website_url: String,
28 | | pub wiki_url: String,
29 | | pub issues_url: String,
30 | | pub source_url: String,
31 | | }
| |_^
|
= help: remove the postfixes
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#struct_field_names
|
this match arm has an identical body to another arm:
src/api/models/server/server_type.rs#L274
warning: this match arm has an identical body to another arm
--> src/api/models/server/server_type.rs:274:13
|
274 | ServerType::BuildTools { .. } => Ok(false),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try changing either arm body
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
help: or try merging the arm patterns
|
274 | ServerType::BuildTools { .. } | ServerType::Vanilla {} => Ok(false),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: and remove this obsolete arm
|
225 - ServerType::Vanilla {} => Ok(false),
|
|
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#L45
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:45:31
|
45 | pub fn supports_eula_args(&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
|
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#L38
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:38:27
|
38 | pub fn supports_nogui(&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
|
this match arm has an identical body to another arm:
src/api/models/server/server_flavor.rs#L33
warning: this match arm has an identical body to another arm
--> src/api/models/server/server_flavor.rs:33:13
|
33 | ServerFlavor::Patched => true,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try changing either arm body
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
help: or try merging the arm patterns
|
33 | ServerFlavor::Patched | ServerFlavor::Proxy => true,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: and remove this obsolete arm
|
34 - ServerFlavor::Proxy => true,
35 - }
34 + }
|
|
this match arm has an identical body to another arm:
src/api/models/server/server_flavor.rs#L32
warning: this match arm has an identical body to another arm
--> src/api/models/server/server_flavor.rs:32:13
|
32 | ServerFlavor::Modded => false,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try changing either arm body
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
= note: `-W clippy::match-same-arms` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::match_same_arms)]`
help: or try merging the arm patterns
|
32 | ServerFlavor::Modded | ServerFlavor::Vanilla => false,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: and remove this obsolete arm
|
31 - ServerFlavor::Vanilla => false,
|
|
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#L29
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:29:29
|
29 | 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
|
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#L22
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:22:26
|
22 | 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
|
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#L15
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:15:31
|
15 | 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
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/models/metadata/addon_metadata.rs#L67
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/models/metadata/addon_metadata.rs:67:21
|
67 | pub fn icon_url(&self) -> String {
| ^^^^^ 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
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/models/metadata/addon_metadata.rs#L63
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/models/metadata/addon_metadata.rs:63:17
|
63 | pub fn html(&self) -> String {
| ^^^^^ 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
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/models/metadata/addon_metadata.rs#L59
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/models/metadata/addon_metadata.rs:59:25
|
59 | pub fn markdown_tag(&self) -> String {
| ^^^^^ 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
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/models/metadata/addon_metadata.rs#L46
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/models/metadata/addon_metadata.rs:46:21
|
46 | pub fn into_str(&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
|
this argument is passed by value, but not consumed in the function body:
src/api/models/markdown/render.rs#L14
warning: this argument is passed by value, but not consumed in the function body
--> src/api/models/markdown/render.rs:14:38
|
14 | pub fn table_addons(&self, list: Vec<AddonMetadata>, output: MarkdownOutput) -> MarkdownTable {
| ^^^^^^^^^^^^^^^^^^ help: consider changing the type to: `&[AddonMetadata]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
= note: `-W clippy::needless-pass-by-value` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::needless_pass_by_value)]`
|
field name starts with the struct's name:
src/api/models/addon/addon.rs#L18
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)]`
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/models/env.rs#L31
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/models/env.rs:31:19
|
31 | pub fn client(&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
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/models/env.rs#L27
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/models/env.rs:27:19
|
27 | pub fn server(&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)]`
|
adding items after statements is confusing, since items exist from the start of the scope:
src/api/app/step/execute_java.rs#L35
warning: adding items after statements is confusing, since items exist from the start of the scope
--> src/api/app/step/execute_java.rs:35:9
|
35 | / fn on_line(line: &str) {
36 | | println!("| {line}");
37 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
|
this function has too many lines (104/100):
src/api/app/step/cache_check.rs#L20
warning: this function has too many lines (104/100)
--> src/api/app/step/cache_check.rs:20:5
|
20 | / pub(super) async fn execute_step_cache_check(
21 | | &self,
22 | | dir: &Path,
23 | | metadata: &FileMeta,
... |
161 | | Ok(StepResult::Skip)
162 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines
= note: `-W clippy::too-many-lines` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::too_many_lines)]`
|
adding items after statements is confusing, since items exist from the start of the scope:
src/api/app/actions/build/bootstrap.rs#L60
warning: adding items after statements is confusing, since items exist from the start of the scope
--> src/api/app/actions/build/bootstrap.rs:60:9
|
60 | const MAX_CONCURRENT_TASKS: usize = 20;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
= note: `-W clippy::items-after-statements` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::items_after_statements)]`
|
unreachable pattern:
src/api/models/markdown/render.rs#L52
warning: unreachable pattern
--> src/api/models/markdown/render.rs:52:25
|
52 | _ => meta.source.into_str().to_owned(),
| ^
|
= note: `#[warn(unreachable_patterns)]` on by default
|
binding's name is too similar to existing binding:
src/api/utils/pathdiff.rs#L80
warning: binding's name is too similar to existing binding
--> src/api/utils/pathdiff.rs:80:17
|
80 | let mut itb = base.components();
| ^^^
|
note: existing binding defined here
--> src/api/utils/pathdiff.rs:79:17
|
79 | let mut ita = path.components();
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#similar_names
|
redundant else block:
src/api/app/step/cache_check.rs#L86
warning: redundant else block
--> src/api/app/step/cache_check.rs:86:28
|
86 | } else {
| ____________________________^
87 | | // hash mismatch
88 | | // TODO: print warning
89 | | println!("WARNING Hash mismatch: {}", metadata.filename);
... |
92 | | .context("hash mismatch remove file")?;
93 | | }
| |_____________________^
|
= help: remove the `else` block and move the contents out
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_else
= note: `-W clippy::redundant-else` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::redundant_else)]`
|
binding's name is too similar to existing binding:
src/api/app/http.rs#L22
warning: binding's name is too similar to existing binding
--> src/api/app/http.rs:22:13
|
22 | let res = req.send().await?.error_for_status()?;
| ^^^
|
note: existing binding defined here
--> src/api/app/http.rs:18:13
|
18 | let req = self.http_client.get(url.as_str());
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#similar_names
= note: `-W clippy::similar-names` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::similar_names)]`
|
clippy
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
clippy
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
build (ubuntu-latest)
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions/upload-artifact@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
build (windows-latest)
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions/upload-artifact@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Deprecation notice: v1, v2, and v3 of the artifact actions
The following artifacts were uploaded using a version of actions/upload-artifact that is scheduled for deprecation: "mcman-ubuntu-latest", "mcman-windows-latest".
Please update your workflow to use v4 of the artifact actions.
Learn more: https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
mcman-ubuntu-latest
Expired
|
7.76 MB |
|
mcman-windows-latest
Expired
|
12 MB |
|