network stuff and fix util semver fn #93
clippy
57 errors, 111 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 57 |
Warning | 111 |
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 215 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:186:5
|
186 | / pub async fn resolved_to_mod(&self, resolved_file: &ResolvedFile) -> Result<Mod> {
187 | | let hash = App::get_best_hash(&resolved_file.hashes);
188 | |
189 | | let (hash_format, hash) = match hash {
... |
214 | | })
215 | | }
| |_____^
|
= 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 368 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:368:14
|
368 | _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 327 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:327:50
|
327 | ... .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 325 in src/hot_reload/mod.rs
github-actions / clippy
redundant closure
warning: redundant closure
--> src/hot_reload/mod.rs:325:41
|
325 | ... .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 324 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:323:48
|
323 | let (report_path, _) = folder.read_dir()?
| ________________________________________________^
324 | | .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 306 in src/hot_reload/mod.rs
github-actions / clippy
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> src/hot_reload/mod.rs:299:17
|
299 | / match test_result {
300 | | TestResult::Crashed => {
301 | | println!(
302 | | " - Server crashed"
... |
305 | | _ => {}
306 | | }
| |_________________^
|
= 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
|
299 ~ if let TestResult::Crashed = test_result {
300 + println!(
301 + " - Server crashed"
302 + );
303 + }
|
Check warning on line 231 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:228:25
|
228 | / println!(
229 | | "{}{s}",
230 | | style("| ").bold()
231 | | )
| |_________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a `;` here
|
228 ~ println!(
229 + "{}{s}",
230 + style("| ").bold()
231 + );
|
Check warning on line 190 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:190:36
|
190 | ... 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 161 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:161:37
|
161 | ... _ = 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 141 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:141:37
|
141 | ... _ = 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 150 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:146:53
|
146 | / ... println!(
147 | | ... "{}{}",
148 | | ... style("| ").bold(),
149 | | ... line.trim()
150 | | ... )
| |_______________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a `;` here
|
146 ~ println!(
147 + "{}{}",
148 + style("| ").bold(),
149 + line.trim()
150 + );
|
Check warning on line 363 in src/hot_reload/mod.rs
github-actions / clippy
this function has too many lines (235/100)
warning: this function has too many lines (235/100)
--> src/hot_reload/mod.rs:93:5
|
93 | / async fn handle_commands(mut self, mut rx: mpsc::Receiver<Command>, mut tx: mpsc::Sender<Command>) -> Result<()> {
94 | | let mp = self.builder.app.multi_progress.clone();
95 | |
96 | | let mut child: Option<Child> = None;
... |
362 | | Ok(())
363 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines
Check failure on line 80 in src/hot_reload/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/hot_reload/mod.rs:80:25
|
80 | &self.builder.app,
| ^^^^^^^^^^^^^^^^^ help: change this to: `self.builder.app`
|
= 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 43 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:41:17
|
41 | / content = re.replace_all(&content, |_caps: ®ex::Captures| {
42 | | format!("<!--start:mcman-{id}-->\n{}\n<!--end:mcman-{id}-->", table.render())
43 | | }).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
|
41 ~ content = re.replace_all(&content, |_caps: ®ex::Captures| {
42 + format!("<!--start:mcman-{id}-->\n{}\n<!--end:mcman-{id}-->", table.render())
43 + }).to_string();
|
Check warning on line 207 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:207:21
|
207 | "md5" => HashFormat::Md5,
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the arm
|
= help: or try changing either arm body
note: `_` wildcard arm here
--> src/interop/packwiz.rs:209:21
|
209 | _ => HashFormat::Md5,
| ^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
Check warning on line 195 in src/interop/packwiz.rs
github-actions / clippy
this could be rewritten as `let...else`
warning: this could be rewritten as `let...else`
--> src/interop/packwiz.rs:189:9
|
189 | / let (hash_format, hash) = match hash {
190 | | Some(t) => t,
191 | | None => {
192 | | // TODO calculate hash manually (by cached file or download it and compute)
193 | | todo!()
194 | | }
195 | | };
| |__________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
= note: `#[warn(clippy::manual_let_else)]` implied by `#[warn(clippy::pedantic)]`
help: consider writing
|
189 ~ let Some((hash_format, hash)) = hash else {
190 + // TODO calculate hash manually (by cached file or download it and compute)
191 + todo!()
192 + };
|
Check failure on line 179 in src/interop/packwiz.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/interop/packwiz.rs:179:42
|
179 | let resolved = dl.resolve_source(&self.0).await?;
| ^^^^^^^ help: change this to: `self.0`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow