[wip] rewrite daedalus, vanilla, fabric, and quilt #138
clippy
16 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 16 |
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 127 in daedalus_client/src/main.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> daedalus_client/src/main.rs:127:39
|
127 | .entry(get_path_from_artifact(&artifact)?)
| ^^^^^^^^^ help: change this to: `artifact`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 250 in daedalus_client/src/util.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> daedalus_client/src/util.rs:250:25
|
250 | &path,
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 234 in daedalus_client/src/util.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> daedalus_client/src/util.rs:234:29
|
234 | ... &path,
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 221 in daedalus_client/src/util.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> daedalus_client/src/util.rs:221:29
|
221 | ... &path,
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 173 in daedalus_client/src/util.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> daedalus_client/src/util.rs:173:48
|
173 | .initiate_multipart_upload(&path, &content_type)
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 149 in daedalus_client/src/util.rs
github-actions / clippy
called `map(..).flatten()` on `Option`
warning: called `map(..).flatten()` on `Option`
--> daedalus_client/src/util.rs:148:18
|
148 | .map(|ct| ct.to_str().ok())
| __________________^
149 | | .flatten()
| |__________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|ct| ct.to_str().ok())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `#[warn(clippy::map_flatten)]` on by default
Check warning on line 59 in daedalus_client/src/util.rs
github-actions / clippy
returning the result of a `let` binding from a block
warning: returning the result of a `let` binding from a block
--> daedalus_client/src/util.rs:59:9
|
52 | / let client = reqwest::Client::builder()
53 | | .tcp_keepalive(Some(std::time::Duration::from_secs(10)))
54 | | .timeout(std::time::Duration::from_secs(15))
55 | | .default_headers(headers)
56 | | .build()
57 | | .unwrap();
| |______________________- unnecessary `let` binding
58 |
59 | client
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
= note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
|
52 ~
53 |
54 ~ reqwest::Client::builder()
55 + .tcp_keepalive(Some(std::time::Duration::from_secs(10)))
56 + .timeout(std::time::Duration::from_secs(15))
57 + .default_headers(headers)
58 + .build()
59 + .unwrap()
|
Check warning on line 104 in daedalus_client/src/minecraft.rs
github-actions / clippy
redundant closure
warning: redundant closure
--> daedalus_client/src/minecraft.rs:104:48
|
104 | .map(|x| serde_json::to_vec(x).map(|x| bytes::Bytes::from(x)))
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `bytes::Bytes::from`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
Check warning on line 169 in daedalus_client/src/fabric.rs
github-actions / clippy
redundant closure
warning: redundant closure
--> daedalus_client/src/fabric.rs:169:48
|
169 | .map(|x| serde_json::to_vec(x).map(|x| bytes::Bytes::from(x)))
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `bytes::Bytes::from`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
= note: `#[warn(clippy::redundant_closure)]` on by default
Check warning on line 148 in daedalus_client/src/fabric.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> daedalus_client/src/fabric.rs:148:29
|
148 | ... &mirror_artifacts,
| ^^^^^^^^^^^^^^^^^ help: change this to: `mirror_artifacts`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 109 in daedalus_client/src/fabric.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> daedalus_client/src/fabric.rs:109:17
|
109 | &mirror_artifacts,
| ^^^^^^^^^^^^^^^^^ help: change this to: `mirror_artifacts`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
Check warning on line 259 in daedalus_client/src/fabric.rs
github-actions / clippy
fields `separator`, `build`, and `maven` are never read
warning: fields `separator`, `build`, and `maven` are never read
--> daedalus_client/src/fabric.rs:259:9
|
258 | struct FabricLoaderVersion {
| ------------------- fields in this struct
259 | pub separator: String,
| ^^^^^^^^^
260 | pub build: u32,
| ^^^^^
261 | pub maven: String,
| ^^^^^
|
= note: `FabricLoaderVersion` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
Check warning on line 197 in daedalus_client/src/minecraft.rs
github-actions / clippy
type `minecraft::LibraryPatch` is more private than the item `minecraft::patch_library`
warning: type `minecraft::LibraryPatch` is more private than the item `minecraft::patch_library`
--> daedalus_client/src/minecraft.rs:194:1
|
194 | / pub fn patch_library(
195 | | patches: &Vec<LibraryPatch>,
196 | | mut library: Library,
197 | | ) -> Vec<Library> {
| |_________________^ function `minecraft::patch_library` is reachable at visibility `pub(crate)`
|
note: but type `minecraft::LibraryPatch` is only usable at visibility `pub(self)`
--> daedalus_client/src/minecraft.rs:178:1
|
178 | struct LibraryPatch {
| ^^^^^^^^^^^^^^^^^^^
= note: `#[warn(private_interfaces)]` on by default
Check warning on line 7 in daedalus_client/src/main.rs
github-actions / clippy
unused import: `std::time::Duration`
warning: unused import: `std::time::Duration`
--> daedalus_client/src/main.rs:7:5
|
7 | use std::time::Duration;
| ^^^^^^^^^^^^^^^^^^^
Check warning on line 2 in daedalus_client/src/main.rs
github-actions / clippy
unused import: `upload_url_to_bucket`
warning: unused import: `upload_url_to_bucket`
--> daedalus_client/src/main.rs:2:28
|
2 | upload_file_to_bucket, upload_url_to_bucket, upload_url_to_bucket_mirrors,
| ^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
Check warning on line 36 in daedalus/src/modded.rs
github-actions / clippy
use of deprecated method `chrono::TimeZone::datetime_from_str`: use `DateTime::parse_from_str` or `NaiveDateTime::parse_from_str` with `and_utc()` or `and_local_timezone()` instead
warning: use of deprecated method `chrono::TimeZone::datetime_from_str`: use `DateTime::parse_from_str` or `NaiveDateTime::parse_from_str` with `and_utc()` or `and_local_timezone()` instead
--> daedalus/src/modded.rs:36:26
|
36 | .or_else(|_| Utc.datetime_from_str(&s, "%Y-%m-%dT%H:%M:%S%.9f"))
| ^^^^^^^^^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default