Merge pull request #70 from MrNavaStar/patch-1 #120
clippy
9 errors, 11 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 9 |
Warning | 11 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.81.0 (eeb90cda1 2024-09-04)
- cargo 1.81.0 (2dbb1af80 2024-08-20)
- clippy 0.1.81 (eeb90cd 2024-09-04)
Annotations
Check warning on line 82 in src/main.rs
github-actions / clippy
called `map(<f>).unwrap_or_default()` on a `Result` value
warning: called `map(<f>).unwrap_or_default()` on a `Result` value
--> src/main.rs:81:10
|
81 | .map(|s| s.as_str() == "true")
| __________^
82 | | .unwrap_or_default()
| |____________________________^ help: use: `is_ok_and(|s| s.as_str() == "true")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_variant_and
Check failure on line 19 in src/util/mod.rs
github-actions / clippy
direct implementation of `ToString`
error: direct implementation of `ToString`
--> src/util/mod.rs:12:1
|
12 | / impl<T> ToString for SelectItem<T> {
13 | | fn to_string(&self) -> String {
14 | | match &self.1 {
15 | | Cow::Borrowed(s) => (*s).to_string(),
... |
18 | | }
19 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
Check failure on line 159 in src/model/servertype/mod.rs
github-actions / clippy
direct implementation of `ToString`
error: direct implementation of `ToString`
--> src/model/servertype/mod.rs:141:1
|
141 | / impl ToString for ServerType {
142 | | fn to_string(&self) -> String {
143 | | match self {
144 | | ServerType::Vanilla {} => String::from("Vanilla"),
... |
158 | | }
159 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
Check warning on line 152 in src/model/servertoml.rs
github-actions / clippy
assigning the result of `Clone::clone()` may be inefficient
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/model/servertoml.rs:152:13
|
152 | self.mc_version = v.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `self.mc_version.clone_from(v)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
Check warning on line 52 in src/model/lockfile.rs
github-actions / clippy
assigning the result of `ToOwned::to_owned()` may be inefficient
warning: assigning the result of `ToOwned::to_owned()` may be inefficient
--> src/model/lockfile.rs:52:9
|
52 | nw.path = path.to_owned();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `path.clone_into(&mut nw.path)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
Check failure on line 142 in src/model/downloadable/markdown.rs
github-actions / clippy
direct implementation of `ToString`
error: direct implementation of `ToString`
--> src/model/downloadable/markdown.rs:138:1
|
138 | / impl ToString for Downloadable {
139 | | fn to_string(&self) -> String {
140 | | self.to_short_string()
141 | | }
142 | | }
| |_^
|
= 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)]`
Check warning on line 78 in src/hot_reload/config.rs
github-actions / clippy
assigning the result of `ToOwned::to_owned()` may be inefficient
warning: assigning the result of `ToOwned::to_owned()` may be inefficient
--> src/hot_reload/config.rs:78:9
|
78 | h.path = path.to_owned();
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `path.clone_into(&mut h.path)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
Check warning on line 149 in src/core/mod.rs
github-actions / clippy
called `map(<f>).unwrap_or_default()` on a `Result` value
warning: called `map(<f>).unwrap_or_default()` on a `Result` value
--> src/core/mod.rs:148:14
|
148 | .map(|s| s.as_str() == "true")
| ______________^
149 | | .unwrap_or_default()
| |________________________________^ help: use: `is_ok_and(|s| s.as_str() == "true")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_variant_and
Check failure on line 57 in src/core/scripts.rs
github-actions / clippy
file opened with `create`, but `truncate` behavior not defined
error: file opened with `create`, but `truncate` behavior not defined
--> src/core/scripts.rs:57:18
|
57 | .create(true)
| ^^^^^^^^^^^^- help: add: `.truncate(true)`
|
= help: if you intend to overwrite an existing file entirely, call `.truncate(true)`
= help: if you instead know that you may want to keep some parts of the old file, call `.truncate(false)`
= help: alternatively, use `.append(true)` to append to the file instead of overwriting it
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options
= note: `-D clippy::suspicious-open-options` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::suspicious_open_options)]`
Check warning on line 99 in src/commands/init/mod.rs
github-actions / clippy
assigning the result of `Clone::clone()` may be inefficient
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/commands/init/mod.rs:99:9
|
99 | app.server.name = name.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `app.server.name.clone_from(&name)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
Check warning on line 82 in src/commands/init/mod.rs
github-actions / clippy
assigning the result of `Clone::clone()` may be inefficient
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/commands/init/mod.rs:82:9
|
82 | app.network.as_mut().unwrap().name = name.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `app.network.as_mut().unwrap().name.clone_from(&name)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
= note: `-W clippy::assigning-clones` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::assigning_clones)]`
Check failure on line 94 in src/app/hashing.rs
github-actions / clippy
the borrowed expression implements the required traits
error: the borrowed expression implements the required traits
--> src/app/hashing.rs:94:24
|
94 | Ok(hex::encode(&digester.finalize()))
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `digester.finalize()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
Check failure on line 74 in src/app/hashing.rs
github-actions / clippy
the borrowed expression implements the required traits
error: the borrowed expression implements the required traits
--> src/app/hashing.rs:74:43
|
74 | let stream_hash = hex::encode(&digester.finalize());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `digester.finalize()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
Check warning on line 170 in src/app/feedback.rs
github-actions / clippy
called `map(<f>).unwrap_or_default()` on a `Result` value
warning: called `map(<f>).unwrap_or_default()` on a `Result` value
--> src/app/feedback.rs:169:14
|
169 | .map(|s| s.as_str() == "true")
| ______________^
170 | | .unwrap_or_default()
| |________________________________^ help: use: `is_ok_and(|s| s.as_str() == "true")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_variant_and
Check warning on line 150 in src/app/feedback.rs
github-actions / clippy
called `map(<f>).unwrap_or_default()` on a `Result` value
warning: called `map(<f>).unwrap_or_default()` on a `Result` value
--> src/app/feedback.rs:149:14
|
149 | .map(|s| s.as_str() == "true")
| ______________^
150 | | .unwrap_or_default()
| |________________________________^ help: use: `is_ok_and(|s| s.as_str() == "true")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_variant_and
= note: `-W clippy::manual-is-variant-and` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::manual_is_variant_and)]`
Check failure on line 104 in src/app/downloading.rs
github-actions / clippy
the borrowed expression implements the required traits
error: the borrowed expression implements the required traits
--> src/app/downloading.rs:104:47
|
104 | let stream_hash = hex::encode(&digest.finalize());
| ^^^^^^^^^^^^^^^^^^ help: change this to: `digest.finalize()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `-D clippy::needless-borrows-for-generic-args` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::needless_borrows_for_generic_args)]`
Check failure on line 24 in Cargo.toml
github-actions / clippy
lint group `pedantic` has the same priority (0) as a lint
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 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Check failure on line 23 in Cargo.toml
github-actions / clippy
lint group `all` has the same priority (0) as a lint
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 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Check warning on line 29 in src/core/mod.rs
github-actions / clippy
field `server_process` is never read
warning: field `server_process` is never read
--> src/core/mod.rs:29:9
|
20 | pub struct BuildContext<'a> {
| ------------ field in this struct
...
29 | pub server_process: Option<Child>,
| ^^^^^^^^^^^^^^
|
= note: `BuildContext` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
Check warning on line 3 in src/app/progress.rs
github-actions / clippy
trait `ProgressBarExt` is never used
warning: trait `ProgressBarExt` is never used
--> src/app/progress.rs:3:11
|
3 | pub trait ProgressBarExt {}
| ^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default