docs n stuff #104
clippy
63 errors, 133 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 63 |
Warning | 133 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.73.0 (cc66ad468 2023-10-03)
- cargo 1.73.0 (9c4383fb5 2023-08-26)
- clippy 0.1.73 (cc66ad4 2023-10-03)
Annotations
Check warning on line 189 in src/commands/init/mod.rs
github-actions / clippy
calls to `std::mem::drop` with a reference instead of an owned value does nothing
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
--> src/commands/init/mod.rs:189:17
|
189 | drop(nw);
| ^^^^^--^
| |
| argument has type `&mut model::network::Network`
|
= note: use `let _ = ...` to ignore the expression or result
= note: `#[warn(dropping_references)]` on by default
Check warning on line 229 in src/interop/packwiz.rs
github-actions / clippy
unused `async` for function with no await statements
warning: unused `async` for function with no await statements
--> src/interop/packwiz.rs:200:5
|
200 | / pub async fn resolved_to_mod(&self, resolved_file: &ResolvedFile) -> Result<Mod> {
201 | | let hash = App::get_best_hash(&resolved_file.hashes);
202 | |
203 | | let (hash_format, hash) = match hash {
... |
228 | | })
229 | | }
| |_____^
|
= 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 99 in src/commands/cache.rs
github-actions / clippy
unused `async` for function with no await statements
warning: unused `async` for function with no await statements
--> src/commands/cache.rs:25:1
|
25 | / pub async fn run(commands: Commands) -> Result<()> {
26 | | let Some(cache_folder) = Cache::cache_root() else {
27 | | bail!("Cache directory was missing, maybe it's disabled?");
28 | | };
... |
98 | | Ok(())
99 | | }
| |_^
|
= 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 72 in src/commands/world/unpack.rs
github-actions / clippy
unused `async` for function with no await statements
warning: unused `async` for function with no await statements
--> src/commands/world/unpack.rs:15:1
|
15 | / pub async fn run(app: App, args: Args) -> Result<()> {
16 | | let zipfile = if let Some(s) = args.world {
17 | | app.server.path.join("worlds").join(if s.ends_with(".zip") {
18 | | s.clone()
... |
71 | | Ok(())
72 | | }
| |_^
|
= 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 166 in src/commands/add/modrinth.rs
github-actions / clippy
unused `async` for function with no await statements
warning: unused `async` for function with no await statements
--> src/commands/add/modrinth.rs:16:1
|
16 | / pub async fn run(mut app: App, args: Args) -> Result<()> {
17 | | let query = if let Some(s) = args.search {
18 | | s.to_owned()
19 | | } else {
... |
165 | | Ok(())
166 | | }
| |_^
|
= 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/commands/export/packwiz.rs
github-actions / clippy
unused `async` for function with no await statements
warning: unused `async` for function with no await statements
--> src/commands/export/packwiz.rs:17:1
|
17 | / pub async fn run(app: App, args: Args) -> Result<()> {
18 | | let default_output = app.server.path.join("pack");
19 | | let output_dir = args.output.unwrap_or(default_output);
20 | |
... |
25 | | Ok(())
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
= note: `#[warn(clippy::unused_async)]` implied by `#[warn(clippy::pedantic)]`
Check failure on line 30 in src/main.rs
github-actions / clippy
name `CLI` contains a capitalized acronym
error: name `CLI` contains a capitalized acronym
--> src/main.rs:30:8
|
30 | struct CLI {
| ^^^ help: consider making the acronym lowercase, except the initial letter: `Cli`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
= note: `#[deny(clippy::upper_case_acronyms)]` implied by `#[deny(clippy::all)]`
Check warning on line 414 in src/hot_reload/mod.rs
github-actions / clippy
this argument is passed by value, but not consumed in the function body
warning: this argument is passed by value, but not consumed in the function body
--> src/hot_reload/mod.rs:414:14
|
414 | _tx: mpsc::Sender<Command>,
| ^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&mpsc::Sender<Command>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
Check failure on line 364 in src/hot_reload/mod.rs
github-actions / clippy
using `clone` on type `SystemTime` which implements the `Copy` trait
error: using `clone` on type `SystemTime` which implements the `Copy` trait
--> src/hot_reload/mod.rs:364:58
|
364 | ... .max_by_key(|(_, t)| t.clone())
| ^^^^^^^^^ help: try dereferencing it: `*t`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
Check warning on line 362 in src/hot_reload/mod.rs
github-actions / clippy
redundant closure
warning: redundant closure
--> src/hot_reload/mod.rs:362:49
|
362 | ... .filter_map(|f| f.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
Check failure on line 361 in src/hot_reload/mod.rs
github-actions / clippy
useless conversion to the same type: `std::fs::ReadDir`
error: useless conversion to the same type: `std::fs::ReadDir`
--> src/hot_reload/mod.rs:360:56
|
360 | ... let (report_path, _) = folder.read_dir()?
| ______________________________________________^
361 | | ... .into_iter()
| |______________________________________^ help: consider removing `.into_iter()`: `folder.read_dir()?`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[deny(clippy::useless_conversion)]` implied by `#[deny(clippy::all)]`
Check failure on line 332 in src/hot_reload/mod.rs
github-actions / clippy
you seem to be trying to use `match` for an equality check. Consider using `if`
error: you seem to be trying to use `match` for an equality check. Consider using `if`
--> src/hot_reload/mod.rs:325:25
|
325 | / match test_result {
326 | | TestResult::Crashed => {
327 | | println!(
328 | | " - Server crashed"
... |
331 | | _ => {}
332 | | }
| |_________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
= note: `#[deny(clippy::single_match)]` implied by `#[deny(clippy::all)]`
help: try
|
325 ~ if test_result == TestResult::Crashed {
326 + println!(
327 + " - Server crashed"
328 + );
329 + }
|
Check warning on line 242 in src/hot_reload/mod.rs
github-actions / clippy
consider adding a `;` to the last statement for consistent formatting
warning: consider adding a `;` to the last statement for consistent formatting
--> src/hot_reload/mod.rs:239:25
|
239 | / println!(
240 | | "{}{s}",
241 | | style("| ").bold()
242 | | )
| |_________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a `;` here
|
239 ~ println!(
240 + "{}{s}",
241 + style("| ").bold()
242 + );
|
Check warning on line 202 in src/hot_reload/mod.rs
github-actions / clippy
matching over `()` is more explicit
warning: matching over `()` is more explicit
--> src/hot_reload/mod.rs:202:36
|
202 | ... Ok(_) => {},
| ^ help: use `()` instead of `_`: `()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
Check warning on line 173 in src/hot_reload/mod.rs
github-actions / clippy
matching over `()` is more explicit
warning: matching over `()` is more explicit
--> src/hot_reload/mod.rs:173:37
|
173 | ... _ = tokio::time::sleep(Duration::from_secs(30)) => {
| ^ help: use `()` instead of `_`: `()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
Check warning on line 153 in src/hot_reload/mod.rs
github-actions / clippy
matching over `()` is more explicit
warning: matching over `()` is more explicit
--> src/hot_reload/mod.rs:153:37
|
153 | ... _ = async {
| ^ help: use `()` instead of `_`: `()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: `#[warn(clippy::ignored_unit_patterns)]` implied by `#[warn(clippy::pedantic)]`
Check warning on line 162 in src/hot_reload/mod.rs
github-actions / clippy
consider adding a `;` to the last statement for consistent formatting
warning: consider adding a `;` to the last statement for consistent formatting
--> src/hot_reload/mod.rs:158:53
|
158 | / ... println!(
159 | | ... "{}{}",
160 | | ... style("| ").bold(),
161 | | ... line.trim()
162 | | ... )
| |_______________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a `;` here
|
158 ~ println!(
159 + "{}{}",
160 + style("| ").bold(),
161 + line.trim()
162 + );
|
Check warning on line 410 in src/hot_reload/mod.rs
github-actions / clippy
this function has too many lines (267/100)
warning: this function has too many lines (267/100)
--> src/hot_reload/mod.rs:104:5
|
104 | / async fn handle_commands(mut self, mut rx: mpsc::Receiver<Command>, mut tx: mpsc::Sender<Command>) -> Result<()> {
105 | | let mp = self.builder.app.multi_progress.clone();
106 | |
107 | | let mut child: Option<Child> = None;
... |
409 | | Ok(())
410 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines
Check failure on line 86 in src/hot_reload/mod.rs
github-actions / clippy
the borrowed expression implements the required traits
error: the borrowed expression implements the required traits
--> src/hot_reload/mod.rs:86:56
|
86 | let dir = diff_paths(&self.builder.output_dir, &cwd).unwrap();
| ^^^^ help: change this to: `cwd`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check failure on line 82 in src/hot_reload/mod.rs
github-actions / clippy
the borrowed expression implements the required traits
error: the borrowed expression implements the required traits
--> src/hot_reload/mod.rs:82:31
|
82 | self.builder.app.info(&format!("Running: {java} {}", args.join(" ")))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Running: {java} {}", args.join(" "))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check failure on line 10 in src/hot_reload/pattern_serde.rs
github-actions / clippy
question mark operator is useless here
error: question mark operator is useless here
--> src/hot_reload/pattern_serde.rs:9:5
|
9 | / Ok(Pattern::new(&String::deserialize(de)?)
10 | | .map_err(serde::de::Error::custom)?)
| |________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
help: try removing question mark and `Ok()`
|
9 ~ Pattern::new(&String::deserialize(de)?)
10 + .map_err(serde::de::Error::custom)
|
Check warning on line 73 in src/hot_reload/config.rs
github-actions / clippy
implicitly cloning a `PathBuf` by calling `to_owned` on its dereferenced type
warning: implicitly cloning a `PathBuf` by calling `to_owned` on its dereferenced type
--> src/hot_reload/config.rs:73:18
|
73 | h.path = path.to_owned();
| ^^^^^^^^^^^^^^^ help: consider using: `path.clone()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
Check failure on line 33 in src/hot_reload/config.rs
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/hot_reload/config.rs:33:1
|
33 | impl Into<String> for HotReloadAction {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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<hot_reload::config::HotReloadAction>`
|
33 ~ impl From<HotReloadAction> for String {
34 ~ fn from(val: HotReloadAction) -> Self {
35 ~ match val {
|
Check warning on line 83 in src/interop/markdown.rs
github-actions / clippy
consider adding a `;` to the last statement for consistent formatting
warning: consider adding a `;` to the last statement for consistent formatting
--> src/interop/markdown.rs:81:17
|
81 | / content = re.replace_all(&content, |_caps: ®ex::Captures| {
82 | | format!("<!--start:mcman-{id}-->\n{}\n<!--end:mcman-{id}-->", table.render())
83 | | }).to_string()
| |______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a `;` here
|
81 ~ content = re.replace_all(&content, |_caps: ®ex::Captures| {
82 + format!("<!--start:mcman-{id}-->\n{}\n<!--end:mcman-{id}-->", table.render())
83 + }).to_string();
|
Check warning on line 221 in src/interop/packwiz.rs
github-actions / clippy
this match arm has an identical body to the `_` wildcard arm
warning: this match arm has an identical body to the `_` wildcard arm
--> src/interop/packwiz.rs:221:21
|
221 | "md5" => HashFormat::Md5,
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the arm
|
= help: or try changing either arm body
note: `_` wildcard arm here
--> src/interop/packwiz.rs:223:21
|
223 | _ => HashFormat::Md5,
| ^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms