Skip to content

fix hotreload

fix hotreload #91

Triggered via push November 8, 2023 17:55
Status Failure
Total duration 1m 32s
Artifacts

build.yml

on: push
Matrix: build
Fit to window
Zoom out
Zoom in

Annotations

54 errors and 127 warnings
name `CLI` contains a capitalized acronym: src/main.rs#L30
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)]`
this expression creates a reference which is immediately dereferenced by the compiler: src/hot_reload/mod.rs#L59
error: this expression creates a reference which is immediately dereferenced by the compiler --> src/hot_reload/mod.rs:59:25 | 59 | &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
question mark operator is useless here: src/hot_reload/pattern_serde.rs#L9
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) |
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true: src/hot_reload/config.rs#L33
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 = note: `#[deny(clippy::from_over_into)]` implied by `#[deny(clippy::all)]` 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 { |
this expression creates a reference which is immediately dereferenced by the compiler: src/interop/packwiz.rs#L179
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
useless use of `format!`: src/interop/packwiz.rs#L170
error: useless use of `format!` --> src/interop/packwiz.rs:170:29 | 170 | self.0.warn(format!("unknown mod update"))?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"unknown mod update".to_string()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
methods called `from_*` usually take no `self`: src/interop/packwiz.rs#L156
error: methods called `from_*` usually take no `self` --> src/interop/packwiz.rs:156:28 | 156 | pub fn from_mod_update(&self, mod_update: &Option<ModUpdate>) -> Result<Option<Downloadable>> { | ^^^^^ | = 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 `from_*` usually take no `self`: src/interop/packwiz.rs#L139
error: methods called `from_*` usually take no `self` --> src/interop/packwiz.rs:139:28 | 139 | pub async fn from_hash(&self, down: &ModDownload) -> Result<Option<Downloadable>> { | ^^^^^ | = 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 `from_*` usually take no `self`: src/interop/packwiz.rs#L125
error: methods called `from_*` usually take no `self` --> src/interop/packwiz.rs:125:27 | 125 | pub async fn from_mod(&self, m: &Mod) -> Result<Downloadable> { | ^^^^^ | = 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: `#[deny(clippy::wrong_self_convention)]` implied by `#[deny(clippy::all)]`
single-character string constant used as pattern: src/util/mod.rs#L42
error: single-character string constant used as pattern --> src/util/mod.rs:42:33 | 42 | let folder = folder.replace(" ", "-"); | ^^^ help: try using a `char` instead: `' '` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
single-character string constant used as pattern: src/util/mod.rs#L40
error: single-character string constant used as pattern --> src/util/mod.rs:40:33 | 40 | let folder = folder.replace("/", " "); | ^^^ help: try using a `char` instead: `'/'` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
returning the result of a `let` binding from a block: src/util/mod.rs#L43
error: returning the result of a `let` binding from a block --> src/util/mod.rs:43:5 | 42 | let folder = folder.replace(" ", "-"); | -------------------------------------- unnecessary `let` binding 43 | folder | ^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return = note: `#[deny(clippy::let_and_return)]` implied by `#[deny(clippy::all)]` help: return the expression directly | 42 ~ 43 ~ folder.replace(" ", "-") |
use of `unwrap_or` to construct default value: src/util/env.rs#L49
error: use of `unwrap_or` to construct default value --> src/util/env.rs:49:56 | 49 | let contents = fs::read_to_string(&gitignore_path).unwrap_or(String::new()); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default = note: `#[deny(clippy::unwrap_or_default)]` implied by `#[deny(clippy::all)]`
needlessly taken reference of both operands: src/sources/hangar.rs#L41
error: needlessly taken reference of both operands --> src/sources/hangar.rs:41:27 | 41 | .find(|v| &v.name == &version) | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref = note: `#[deny(clippy::op_ref)]` implied by `#[deny(clippy::all)]` help: use the values directly | 41 | .find(|v| v.name == version) | ~~~~~~ ~~~~~~~
using `.iter().next()` on an array: src/sources/hangar.rs#L23
error: using `.iter().next()` on an array --> src/sources/hangar.rs:23:13 | 23 | / versions 24 | | .result 25 | | .iter() 26 | | .next() | |_______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_next_slice = note: `#[deny(clippy::iter_next_slice)]` implied by `#[deny(clippy::all)]` help: try calling | 23 ~ versions 24 + .result.first() |
build (ubuntu-latest)
Process completed with exit code 101.
comparison to empty slice: src/sources/modrinth.rs#L173
error: comparison to empty slice --> src/sources/modrinth.rs:173:71 | 173 | self.fetch_api(&format!("{API_URL}/version_file/{hash}{}", if algo == "" || algo == "sha1" { | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `algo.is_empty()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty = note: `#[deny(clippy::comparison_to_empty)]` implied by `#[deny(clippy::all)]`
single-character string constant used as pattern: src/sources/maven.rs#L120
error: single-character string constant used as pattern --> src/sources/maven.rs:120:30 | 120 | group_id.replace(".", "/"), | ^^^ help: try using a `char` instead: `'.'` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
single-character string constant used as pattern: src/sources/jenkins.rs#L30
error: single-character string constant used as pattern --> src/sources/jenkins.rs:30:33 | 30 | let folder = folder.replace(" ", "-"); | ^^^ help: try using a `char` instead: `' '` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
single-character string constant used as pattern: src/sources/jenkins.rs#L28
error: single-character string constant used as pattern --> src/sources/jenkins.rs:28:33 | 28 | let folder = folder.replace("/", " "); | ^^^ help: try using a `char` instead: `'/'` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern = note: `#[deny(clippy::single_char_pattern)]` implied by `#[deny(clippy::all)]`
question mark operator is useless here: src/sources/github.rs#L148
error: question mark operator is useless here --> src/sources/github.rs:148:9 | 148 | / Ok( 149 | | self.fetch_api::<Vec<GithubRelease>>( 150 | | format!("{API_URL}/repos/{repo}/releases"), 151 | | format!("{repo}/releases.json") 152 | | ).await? 153 | | ) | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark = note: `#[deny(clippy::needless_question_mark)]` implied by `#[deny(clippy::all)]` help: try removing question mark and `Ok()` | 148 ~ self.fetch_api::<Vec<GithubRelease>>( 149 + format!("{API_URL}/repos/{repo}/releases"), 150 + format!("{repo}/releases.json") 151 + ).await |
this if-let expression is unnecessary: src/sources/github.rs#L89
error: this if-let expression is unnecessary --> src/sources/github.rs:89:13 | 89 | / if let Some(json) = cache.try_get_json::<CachedData<T>>(&cache_path)? { 90 | | Some(json) 91 | | } else { 92 | | None 93 | | } | |_____________^ help: replace it with: `cache.try_get_json::<CachedData<T>>(&cache_path)?` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_match = note: `#[deny(clippy::needless_match)]` implied by `#[deny(clippy::all)]`
manual implementation of `Option::map`: src/sources/github.rs#L89
error: manual implementation of `Option::map` --> src/sources/github.rs:89:13 | 89 | / if let Some(json) = cache.try_get_json::<CachedData<T>>(&cache_path)? { 90 | | Some(json) 91 | | } else { 92 | | None 93 | | } | |_____________^ help: try: `cache.try_get_json::<CachedData<T>>(&cache_path)?.map(|json| json)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map
writing `&PathBuf` instead of `&Path` involves a new object where a slice will do: src/model/lockfile/mod.rs#L54
error: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do --> src/model/lockfile/mod.rs:54:37 | 54 | pub fn get_lockfile(output_dir: &PathBuf) -> Result<Self> { | ^^^^^^^^ help: change this to: `&Path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg = note: `#[deny(clippy::ptr_arg)]` implied by `#[deny(clippy::all)]`
useless use of `format!`: src/model/servertype/mod.rs#L313
error: useless use of `format!` --> src/model/servertype/mod.rs:313:44 | 313 | ServerType::BungeeCord { } => format!("BungeeCord"), | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"BungeeCord".to_string()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
useless use of `format!`: src/model/servertype/mod.rs#L312
error: useless use of `format!` --> src/model/servertype/mod.rs:312:43 | 312 | ServerType::Waterfall { } => format!("Waterfall"), | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Waterfall".to_string()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
useless use of `format!`: src/model/servertype/mod.rs#L311
error: useless use of `format!` --> src/model/servertype/mod.rs:311:42 | 311 | ServerType::Velocity { } => format!("Velocity"), | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Velocity".to_string()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
useless use of `format!`: src/model/servertype/mod.rs#L310
error: useless use of `format!` --> src/model/servertype/mod.rs:310:39 | 310 | ServerType::Paper { } => format!("Paper"), | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Paper".to_string()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
you are using an explicit closure for cloning elements: src/model/servertoml/mod.rs#L112
error: you are using an explicit closure for cloning elements --> src/model/servertoml/mod.rs:112:9 | 112 | / list.iter() 113 | | .filter(|v| { 114 | | is_proxy || v.game_versions.contains(mcver) 115 | | }) ... | 126 | | }) 127 | | .map(|v| v.clone()) | |___________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone = note: `#[deny(clippy::map_clone)]` implied by `#[deny(clippy::all)]` help: consider calling the dedicated `cloned` method | 112 ~ list.iter() 113 + .filter(|v| { 114 + is_proxy || v.game_versions.contains(mcver) 115 + }) 116 + .filter(|v| { 117 + if let Some(n) = &loader { 118 + v.loaders.iter().any(|l| l == "datapack" || l == n || (l == "fabric" && n == "quilt")) 119 + } else { 120 + if is_vanilla { 121 + v.loaders.contains(&"datapack".to_owned()) 122 + } else { 123 + true 124 + } 125 + } 126 + }).cloned() |
this expression creates a reference which is immediately dereferenced by the compiler: src/app/mod.rs#L165
error: this expression creates a reference which is immediately dereferenced by the compiler --> src/app/mod.rs:165:47 | 165 | crate::interop::markdown::MarkdownAPI(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
matching on `Some` with `ok()` is redundant: src/app/mod.rs#L109
error: matching on `Some` with `ok()` is redundant --> src/app/mod.rs:109:18 | 109 | k => if let Some(v) = std::env::var(k).ok() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok = note: `#[deny(clippy::match_result_ok)]` implied by `#[deny(clippy::all)]` help: consider matching on `Ok(v)` and removing the call to `ok` instead | 109 | k => if let Ok(v) = std::env::var(k) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
useless use of `vec!`: src/app/from_string.rs#L242
error: useless use of `vec!` --> src/app/from_string.rs:242:54 | 242 | let selection = self.select(&urlstr, &vec![ | ______________________________________________________^ 243 | | SelectItem(0, "Add as Custom URL".to_owned()), 244 | | SelectItem(1, "Add as Jenkins".to_owned()), 245 | | ])?; | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec help: you can use a slice directly | 242 ~ let selection = self.select(&urlstr, &[SelectItem(0, "Add as Custom URL".to_owned()), 243 ~ SelectItem(1, "Add as Jenkins".to_owned())])?; |
this expression creates a reference which is immediately dereferenced by the compiler: src/app/from_string.rs#L242
error: this expression creates a reference which is immediately dereferenced by the compiler --> src/app/from_string.rs:242:45 | 242 | let selection = self.select(&urlstr, &vec![ | ^^^^^^^ help: change this to: `urlstr` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
manual implementation of `Option::map`: src/app/downloading.rs#L65
error: manual implementation of `Option::map` --> src/app/downloading.rs:65:17 | 65 | / if let Some(cache) = self.get_cache(namespace) { 66 | | Some((cache.path(path), cache.exists(path))) 67 | | } else { 68 | | None 69 | | } | |_________________^ help: try: `self.get_cache(namespace).map(|cache| (cache.path(path), cache.exists(path)))` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map = note: `#[deny(clippy::manual_map)]` implied by `#[deny(clippy::all)]`
this expression creates a reference which is immediately dereferenced by the compiler: src/app/downloading.rs#L46
error: this expression creates a reference which is immediately dereferenced by the compiler --> src/app/downloading.rs:46:50 | 46 | let resolved = resolvable.resolve_source(&self).await | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
the borrowed expression implements the required traits: src/core/mod.rs#L131
error: the borrowed expression implements the required traits --> src/core/mod.rs:131:34 | 131 | self.output_dir.join(&folder_path), | ^^^^^^^^^^^^ help: change this to: `folder_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/core/mod.rs#L68
error: this expression creates a reference which is immediately dereferenced by the compiler --> src/core/mod.rs:68:66 | 68 | let startup = self.app.server.jar.get_startup_method(&self.app, &server_jar).await?; | ^^^^^^^^^ help: change this to: `self.app` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
useless use of `format!`: src/core/worlds.rs#L70
error: useless use of `format!` --> src/core/worlds.rs:70:29 | 70 | ).await.context(format!("Processing datapacks"))?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Processing datapacks".to_string()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
useless use of `format!`: src/core/worlds.rs#L58
error: useless use of `format!` --> src/core/worlds.rs:58:45 | 58 | spinner.finish_with_message(format!("Unzipped world successfully")); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Unzipped world successfully".to_string()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format = note: `#[deny(clippy::useless_format)]` implied by `#[deny(clippy::all)]`
this expression creates a reference which is immediately dereferenced by the compiler: src/core/serverjar.rs#L25
error: this expression creates a reference which is immediately dereferenced by the compiler --> src/core/serverjar.rs:25:33 | 25 | .get_install_method(&self.app) | ^^^^^^^^^ help: change this to: `self.app` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
useless use of `vec!`: src/core/bootstrap.rs#L84
error: useless use of `vec!` --> src/core/bootstrap.rs:84:30 | 84 | let bootstrap_exts = vec![ | ______________________________^ 85 | | "properties", "txt", "yaml", "yml", "conf", "config", "toml", "json", "json5", "secret" 86 | | ]; | |_________^ help: you can use an array directly: `["properties", "txt", "yaml", "yml", "conf", "config", "toml", "json", "json5", "secret"]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec = note: `#[deny(clippy::useless_vec)]` implied by `#[deny(clippy::all)]`
using `clone` on type `SystemTime` which implements the `Copy` trait: src/core/bootstrap.rs#L27
error: using `clone` on type `SystemTime` which implements the `Copy` trait --> src/core/bootstrap.rs:27:39 | 27 | .map(|e| (e.path.clone(), e.date.clone()))); | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `e.date` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy = note: `#[deny(clippy::clone_on_copy)]` implied by `#[deny(clippy::all)]`
this let-binding has unit value: src/commands/run.rs#L15
error: this let-binding has unit value --> src/commands/run.rs:15:5 | 15 | let mut ctx = super::build::run(app, args.build_args).await?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `super::build::run(app, args.build_args).await?;` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value = note: `#[deny(clippy::let_unit_value)]` implied by `#[deny(clippy::all)]`
the borrowed expression implements the required traits: src/commands/init/mod.rs#L118
error: the borrowed expression implements the required traits --> src/commands/init/mod.rs:118:48 | 118 | let path = tmp_dir.path().join(&resolved.filename); | ^^^^^^^^^^^^^^^^^^ help: change this to: `resolved.filename` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
casting integer literal to `u16` is unnecessary: src/commands/init/network.rs#L12
error: casting integer literal to `u16` is unnecessary --> src/commands/init/network.rs:12:18 | 12 | .default(25565 as u16) | ^^^^^^^^^^^^ help: try: `25565_u16` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast = note: `#[deny(clippy::unnecessary_cast)]` implied by `#[deny(clippy::all)]`
module has the same name as its containing module: src/commands/init/mod.rs#L20
error: module has the same name as its containing module --> src/commands/init/mod.rs:20:1 | 20 | pub mod init; | ^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception = note: `#[deny(clippy::module_inception)]` implied by `#[deny(clippy::all)]`
the borrowed expression implements the required traits: src/commands/import/mrpack.rs#L24
error: the borrowed expression implements the required traits --> src/commands/import/mrpack.rs:24:40 | 24 | let path = tmp_dir.path().join(&resolved.filename); | ^^^^^^^^^^^^^^^^^^ help: change this to: `resolved.filename` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[deny(clippy::needless_borrow)]` implied by `#[deny(clippy::all)]`
private type `sources::purpur::PurpurMCBuild` in public interface: src/sources/purpur.rs#L34
error[E0446]: private type `sources::purpur::PurpurMCBuild` in public interface --> src/sources/purpur.rs:34:5 | 34 | pub async fn fetch_build(&self, version: &str, build: &str) -> Result<PurpurMCBuild> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type ... 83 | struct PurpurMCBuild { | -------------------- `sources::purpur::PurpurMCBuild` declared as private
private type `sources::purpur::PurpurMCBuilds` in public interface: src/sources/purpur.rs#L30
error[E0446]: private type `sources::purpur::PurpurMCBuilds` in public interface --> src/sources/purpur.rs:30:5 | 30 | pub async fn fetch_builds(&self, version: &str) -> Result<PurpurMCBuilds> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type ... 77 | struct PurpurMCBuilds { | --------------------- `sources::purpur::PurpurMCBuilds` declared as private
this `else { if .. }` block can be collapsed: src/model/servertoml/mod.rs#L119
error: this `else { if .. }` block can be collapsed --> src/model/servertoml/mod.rs:119:20 | 119 | } else { | ____________________^ 120 | | if is_vanilla { 121 | | v.loaders.contains(&"datapack".to_owned()) 122 | | } else { 123 | | true 124 | | } 125 | | } | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if help: collapse nested if block | 119 ~ } else if is_vanilla { 120 + v.loaders.contains(&"datapack".to_owned()) 121 + } else { 122 + true 123 + } |
this `else { if .. }` block can be collapsed: src/app/mod.rs#L111
error: this `else { if .. }` block can be collapsed --> src/app/mod.rs:111:20 | 111 | } else { | ____________________^ 112 | | if k.starts_with("NW_") { 113 | | if let Some(nw) = &self.network { 114 | | nw.variables.get(k.strip_prefix("NW_").unwrap()).cloned() ... | 120 | | } 121 | | } | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if note: the lint level is defined here --> src/main.rs:1:9 | 1 | #![deny(clippy::all)] | ^^^^^^^^^^^ = note: `#[deny(clippy::collapsible_else_if)]` implied by `#[deny(clippy::all)]` help: collapse nested if block | 111 ~ } else if k.starts_with("NW_") { 112 + if let Some(nw) = &self.network { 113 + nw.variables.get(k.strip_prefix("NW_").unwrap()).cloned() 114 + } else { 115 + None 116 + } 117 + } else { 118 + self.server.variables.get(k).cloned() 119 + } |
build (windows-latest)
The job was canceled because "ubuntu-latest" failed.
build (windows-latest)
The operation was canceled.
clippy
Clippy had exited with the 101 exit code
unused `async` for function with no await statements: src/interop/packwiz.rs#L186
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
unused `async` for function with no await statements: src/commands/cache.rs#L25
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
unused `async` for function with no await statements: src/commands/world/unpack.rs#L15
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
unused `async` for function with no await statements: src/commands/add/modrinth.rs#L16
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
unused `async` for function with no await statements: src/commands/export/packwiz.rs#L17
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)]`
matching over `()` is more explicit: src/main.rs#L89
warning: matching over `()` is more explicit --> src/main.rs:89:93 | 89 | Commands::Build(args) => commands::build::run(base_app.upgrade()?, args).await.map(|_| ()), | ^ help: use `()` instead of `_`: `()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
this argument is passed by value, but not consumed in the function body: src/hot_reload/mod.rs#L207
warning: this argument is passed by value, but not consumed in the function body --> src/hot_reload/mod.rs:207:14 | 207 | _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
consider adding a `;` to the last statement for consistent formatting: src/hot_reload/mod.rs#L171
warning: consider adding a `;` to the last statement for consistent formatting --> src/hot_reload/mod.rs:171:25 | 171 | / println!( 172 | | "{}{s}", 173 | | style("| ").bold() 174 | | ) | |_________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned help: add a `;` here | 171 ~ println!( 172 + "{}{s}", 173 + style("| ").bold() 174 + ); |
matching over `()` is more explicit: src/hot_reload/mod.rs#L159
warning: matching over `()` is more explicit --> src/hot_reload/mod.rs:159:36 | 159 | ... Ok(_) => {}, | ^ help: use `()` instead of `_`: `()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
matching over `()` is more explicit: src/hot_reload/mod.rs#L131
warning: matching over `()` is more explicit --> src/hot_reload/mod.rs:131:37 | 131 | ... _ = 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
matching over `()` is more explicit: src/hot_reload/mod.rs#L117
warning: matching over `()` is more explicit --> src/hot_reload/mod.rs:117:37 | 117 | ... _ = 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)]`
consider adding a `;` to the last statement for consistent formatting: src/hot_reload/mod.rs#L121
warning: consider adding a `;` to the last statement for consistent formatting --> src/hot_reload/mod.rs:121:53 | 121 | / ... println!( 122 | | ... "{}{}", 123 | | ... style("| ").bold(), 124 | | ... line.trim() 125 | | ... ) | |_______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned help: add a `;` here | 121 ~ println!( 122 + "{}{}", 123 + style("| ").bold(), 124 + line.trim() 125 + ); |
this function has too many lines (120/100): src/hot_reload/mod.rs#L72
warning: this function has too many lines (120/100) --> src/hot_reload/mod.rs:72:5 | 72 | / async fn handle_commands(mut self, mut rx: mpsc::Receiver<Command>) -> Result<()> { 73 | | let mp = self.builder.app.multi_progress.clone(); 74 | | 75 | | let mut child: Option<Child> = None; ... | 201 | | Ok(()) 202 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines
implicitly cloning a `PathBuf` by calling `to_owned` on its dereferenced type: src/hot_reload/config.rs#L73
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
consider adding a `;` to the last statement for consistent formatting: src/interop/markdown.rs#L41
warning: consider adding a `;` to the last statement for consistent formatting --> src/interop/markdown.rs:41:17 | 41 | / content = re.replace_all(&content, |_caps: &regex::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: &regex::Captures| { 42 + format!("<!--start:mcman-{id}-->\n{}\n<!--end:mcman-{id}-->", table.render()) 43 + }).to_string(); |
this match arm has an identical body to the `_` wildcard arm: src/interop/packwiz.rs#L207
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
this could be rewritten as `let...else`: src/interop/packwiz.rs#L189
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 + }; |
unnecessary boolean `not` operation: src/interop/packwiz.rs#L140
warning: unnecessary boolean `not` operation --> src/interop/packwiz.rs:140:9 | 140 | / if !down.hash.is_empty() { 141 | | let fmt = match down.hash_format { 142 | | HashFormat::Sha512 => "sha512", 143 | | HashFormat::Sha1 => "sha1", ... | 152 | | Ok(None) 153 | | } | |_________^ | = help: remove the `!` 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: `#[warn(clippy::if_not_else)]` implied by `#[warn(clippy::pedantic)]`
this function's return value is unnecessarily wrapped by `Result`: src/interop/mrpack.rs#L222
warning: this function's return value is unnecessarily wrapped by `Result` --> src/interop/mrpack.rs:222:5 | 222 | / pub fn get_files(&self) -> Result<HashMap<String, String>> { 223 | | let mut map = HashMap::new(); 224 | | 225 | | for filename in self.0.file_names() { ... | 245 | | Ok(map) 246 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps help: remove `Result` from the return type... | 222 | pub fn get_files(&self) -> std::collections::HashMap<std::string::String, std::string::String> { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ help: ...and then change returning expressions | 245 | map |
casting `i64` to `u64` may lose the sign of the value: src/sources/hangar.rs#L88
warning: casting `i64` to `u64` may lose the sign of the value --> src/sources/hangar.rs:88:24 | 88 | size: Some(download.get_file_info().size_bytes as u64), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_sign_loss = note: `#[warn(clippy::cast_sign_loss)]` implied by `#[warn(clippy::pedantic)]`
empty String is being created manually: src/sources/modrinth.rs#L174
warning: empty String is being created manually --> src/sources/modrinth.rs:174:13 | 174 | "".to_owned() | ^^^^^^^^^^^^^ help: consider using: `String::new()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_string_new
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/sources/modrinth.rs#L133
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/sources/modrinth.rs:133:28 | 133 | let version_data = match match ver.as_str() { | ____________________________^ 134 | | "latest" => versions.first(), 135 | | ver => versions.iter().find(|v| v.id == ver || v.name == ver || v.version_number == ver) 136 | | } { ... | 145 | | } 146 | | }; | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else help: try | 133 ~ let version_data = if let Some(v) = match ver.as_str() { 134 + "latest" => versions.first(), 135 + ver => versions.iter().find(|v| v.id == ver || v.name == ver || v.version_number == ver) 136 + } { v.clone() } else { 137 + let v = match ver.as_str() { 138 + "latest" => all_versions.first(), 139 + ver => all_versions.iter().find(|v| v.id == ver || v.name == ver || v.version_number == ver) 140 + }.ok_or(anyhow!("Couln't find version '{ver}' ('{version}') for Modrinth project '{id}'"))?.clone(); 141 + self.0.warn(format!("Filtering failed for modrinth.com/mod/{id}/version/{ver}"))?; 142 + v 143 ~ }; |
empty String is being created manually: src/sources/modrinth.rs#L26
warning: empty String is being created manually --> src/sources/modrinth.rs:26:5 | 26 | String::from("") | ^^^^^^^^^^^^^^^^ help: consider using: `String::new()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_string_new = note: `#[warn(clippy::manual_string_new)]` implied by `#[warn(clippy::pedantic)]`
implicitly cloning a `PathBuf` by calling `to_owned` on its dereferenced type: src/model/lockfile/mod.rs#L68
warning: implicitly cloning a `PathBuf` by calling `to_owned` on its dereferenced type --> src/model/lockfile/mod.rs:68:19 | 68 | nw.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
redundant closure: src/model/servertype/mod.rs#L262
warning: redundant closure --> src/model/servertype/mod.rs:262:15 | 262 | }.map(|o| o.to_owned()) | ^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::borrow::ToOwned::to_owned` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
redundant closure: src/model/servertoml/mod.rs#L127
warning: redundant closure --> src/model/servertoml/mod.rs:127:14 | 127 | .map(|v| v.clone()) | ^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::clone::Clone::clone` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
this match arm has an identical body to another arm: src/model/downloadable/markdown.rs#L79
warning: this match arm has an identical body to another arm --> src/model/downloadable/markdown.rs:79:13 | 79 | Self::Modrinth { id, version } | Self::CurseRinth { id, version } | Self::Hangar { id, version } => { | ^----------------------------------------------------------------------------------------------- | | | _____________help: try merging the arm patterns: `Self::Modrinth { id, version } | Self::CurseRinth { id, version } | Self::Hangar { id, version } | Self::Spigot { id, version }` | | 80 | | map.insert("Project/URL".to_owned(), id.clone()); 81 | | map.insert("Version/Release".to_owned(), version.clone()); 82 | | } | |_____________^ | = help: or try changing either arm body note: other arm here --> src/model/downloadable/markdown.rs:84:13 | 84 | / Self::Spigot { id, version } => { 85 | | map.insert("Project/URL".to_owned(), id.clone()); 86 | | map.insert("Version/Release".to_owned(), version.clone()); 87 | | } | |_____________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms = note: `#[warn(clippy::match_same_arms)]` implied by `#[warn(clippy::pedantic)]`
called `map(<f>).unwrap_or(false)` on an `Option` value. This can be done more directly by calling `is_some_and(<f>)` instead: src/app/mod.rs#L131
warning: called `map(<f>).unwrap_or(false)` on an `Option` value. This can be done more directly by calling `is_some_and(<f>)` instead --> src/app/mod.rs:131:9 | 131 | / self.get_cache(ns) 132 | | .map(|c| c.exists(path)) 133 | | .unwrap_or(false) | |_____________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or help: use `is_some_and(<f>)` instead | 132 - .map(|c| c.exists(path)) 132 + .is_some_and(|c| c.exists(path)) |
unused `self` argument: src/app/mod.rs#L125
warning: unused `self` argument --> src/app/mod.rs:125:22 | 125 | pub fn get_cache(&self, ns: &str) -> Option<Cache> { | ^^^^^ | = help: consider refactoring to an associated function = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte): src/app/mod.rs#L33
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) --> src/app/mod.rs:33:19 | 33 | pub fn folder(&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 = note: `#[warn(clippy::trivially_copy_pass_by_ref)]` implied by `#[warn(clippy::pedantic)]`
this function's return value is unnecessary: src/app/feedback.rs#L24
warning: this function's return value is unnecessary --> src/app/feedback.rs:24:5 | 24 | / pub fn info<S: std::fmt::Display>(&self, message: S) -> Result<()> { 25 | | Ok(self.multi_progress.suspend(|| 26 | | println!( 27 | | " {} {message}", ... | 30 | | )) 31 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps = note: `#[warn(clippy::unnecessary_wraps)]` implied by `#[warn(clippy::pedantic)]` help: remove the return type... | 24 | pub fn info<S: std::fmt::Display>(&self, message: S) -> Result<()> { | ~~~~~~~~~~ help: ...and then remove returned values | 25 - Ok(self.multi_progress.suspend(|| 26 - println!( 27 - " {} {message}", 28 - style("🛈 Info").bold() 29 - ) 30 - )) 25 + |
implicitly cloning a `String` by calling `to_owned` on its dereferenced type: src/app/from_string.rs#L227
warning: implicitly cloning a `String` by calling `to_owned` on its dereferenced type --> src/app/from_string.rs:227:66 | 227 | ... SelectItem(Some(a.name.clone()), a.name.to_owned()) | ^^^^^^^^^^^^^^^^^ help: consider using: `a.name.clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/app/from_string.rs#L213
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/app/from_string.rs:213:29 | 213 | let asset = match asset { | _____________________________^ 214 | | Some(a) => a, 215 | | None => { 216 | | let rel = self.github().fetch_release(&repo, &tag).await?; ... | 235 | | } 236 | | }; | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else help: try | 213 ~ let asset = if let Some(a) = asset { a } else { 214 + let rel = self.github().fetch_release(&repo, &tag).await?; 215 + 216 + if rel.assets.len() <= 1 { 217 + "first".to_owned() 218 + } else { 219 + match self.select("Which asset to use?", &vec![ 220 + SelectItem(Some("first".to_owned()), format!( 221 + "Use the first asset ('{}' for '{}')", 222 + rel.assets[0].name, rel.tag_name 223 + )) 224 + ].into_iter().chain(rel.assets.iter().map(|a| { 225 + SelectItem(Some(a.name.clone()), a.name.to_owned()) 226 + })).chain(vec![ 227 + SelectItem(None, "Set manually".to_string()) 228 + ]).collect::<Vec<_>>())? { 229 + Some(a) => a, 230 + None => self.prompt_string("Enter asset name")?, 231 + } 232 + } 233 ~ }; |
calling `to_string` on `&&str`: src/app/from_string.rs#L186
warning: calling `to_string` on `&&str` --> src/app/from_string.rs:186:26 | 186 | (tag.to_string(), match filename { | ^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*tag).to_string()` | = help: `&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inefficient_to_string
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/app/from_string.rs#L183
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/app/from_string.rs:183:36 | 183 | let (tag, asset) = match rest { | ____________________________________^ 184 | | ["releases", "tag" | "download", tag, filename @ ..] => { 185 | | 186 | | (tag.to_string(), match filename { ... | 210 | | } 211 | | }; | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else help: try | 183 ~ let (tag, asset) = if let ["releases", "tag" | "download", tag, filename @ ..] = rest { 184 + 185 + (tag.to_string(), match filename { 186 + [f] => Some(f.replace(tag, "${tag}")), 187 + _ => None, 188 + }) 189 + } else { 190 + let releases = self.github().fetch_releases(&repo).await?; 191 + 192 + let version = self.select("Select a release", &vec![ 193 + SelectItem("latest".to_owned(), "Always use latest release".to_owned()) 194 + ].into_iter().chain(releases.iter().map(|r| { 195 + SelectItem(r.tag_name.clone(), if r.tag_name == r.name { 196 + r.name.clone() 197 + } else { 198 + format!( 199 + "[{}] {}", 200 + r.tag_name, 201 + r.name 202 + ) 203 + }) 204 + })).collect::<Vec<_>>())?; 205 + 206 + (version, None) 207 ~ }; |
calling `to_string` on `&&str`: src/app/from_string.rs#L176
warning: calling `to_string` on `&&str` --> src/app/from_string.rs:176:47 | 176 | Ok(Downloadable::Spigot { id: id.to_string(), version: "latest".to_owned() }) | ^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*id).to_string()` | = help: `&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inefficient_to_string
implicitly cloning a `String` by calling `to_owned` on its dereferenced type: src/app/from_string.rs#L170
warning: implicitly cloning a `String` by calling `to_owned` on its dereferenced type --> src/app/from_string.rs:170:30 | 170 | version: version.to_owned().to_owned(), | ^^^^^^^^^^^^^^^^^^ help: consider using: `version.clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
implicitly cloning a `String` by calling `to_owned` on its dereferenced type: src/app/from_string.rs#L170
warning: implicitly cloning a `String` by calling `to_owned` on its dereferenced type --> src/app/from_string.rs:170:30 | 170 | version: version.to_owned().to_owned(), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `version.to_owned().clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
implicitly cloning a `String` by calling `to_owned` on its dereferenced type: src/app/from_string.rs#L169
warning: implicitly cloning a `String` by calling `to_owned` on its dereferenced type --> src/app/from_string.rs:169:25 | 169 | id: id.to_owned().to_owned(), | ^^^^^^^^^^^^^ help: consider using: `id.clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
implicitly cloning a `String` by calling `to_owned` on its dereferenced type: src/app/from_string.rs#L169
warning: implicitly cloning a `String` by calling `to_owned` on its dereferenced type --> src/app/from_string.rs:169:25 | 169 | id: id.to_owned().to_owned(), | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `id.to_owned().clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
calling `to_string` on `&&str`: src/app/from_string.rs#L144
warning: calling `to_string` on `&&str` --> src/app/from_string.rs:144:33 | 144 | [_, ver] => ver.to_string(), | ^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*ver).to_string()` | = help: `&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inefficient_to_string
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/app/from_string.rs#L143
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/app/from_string.rs:143:31 | 143 | let version = match rest { | _______________________________^ 144 | | [_, ver] => ver.to_string(), 145 | | _ => { 146 | | let (versions, _) = self.curserinth().fetch_versions(&id).await?; ... | 165 | | } 166 | | }; | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else help: try | 143 ~ let version = if let [_, ver] = rest { ver.to_string() } else { 144 + let (versions, _) = self.curserinth().fetch_versions(&id).await?; 145 + 146 + if versions.is_empty() { 147 + bail!("No compatible versions found"); 148 + } 149 + 150 + let version = self.select("Select a version", &versions.iter().map(|v| { 151 + SelectItem(v.clone(), if v.version_number == v.name { 152 + v.version_number.clone() 153 + } else { 154 + format!( 155 + "[{}] {}", 156 + v.version_number, 157 + v.name, 158 + ) 159 + }) 160 + }).collect::<Vec<_>>())?; 161 + 162 + version.id.clone() 163 ~ }; |
implicitly cloning a `String` by calling `to_owned` on its dereferenced type: src/app/from_string.rs#L135
warning: implicitly cloning a `String` by calling `to_owned` on its dereferenced type --> src/app/from_string.rs:135:30 | 135 | version: version.to_owned().to_owned(), | ^^^^^^^^^^^^^^^^^^ help: consider using: `version.clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
implicitly cloning a `String` by calling `to_owned` on its dereferenced type: src/app/from_string.rs#L135
warning: implicitly cloning a `String` by calling `to_owned` on its dereferenced type --> src/app/from_string.rs:135:30 | 135 | version: version.to_owned().to_owned(), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `version.to_owned().clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
calling `to_string` on `&&str`: src/app/from_string.rs#L109
warning: calling `to_string` on `&&str` --> src/app/from_string.rs:109:39 | 109 | ["version", v] => v.to_string(), | ^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*v).to_string()` | = help: `&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inefficient_to_string
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/app/from_string.rs#L108
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/app/from_string.rs:108:31 | 108 | let version = match rest { | _______________________________^ 109 | | ["version", v] => v.to_string(), 110 | | _ => { 111 | | let (versions, _) = self.curserinth().fetch_versions(id).await?; ... | 130 | | } 131 | | }; | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else help: try | 108 ~ let version = if let ["version", v] = rest { v.to_string() } else { 109 + let (versions, _) = self.curserinth().fetch_versions(id).await?; 110 + 111 + if versions.is_empty() { 112 + bail!("No compatible versions found"); 113 + } 114 + 115 + let version = self.select("Select a version", &versions.iter().map(|v| { 116 + SelectItem(v.clone(), if v.version_number == v.name { 117 + v.version_number.clone() 118 + } else { 119 + format!( 120 + "[{}] {}", 121 + v.version_number, 122 + v.name, 123 + ) 124 + }) 125 + }).collect::<Vec<_>>())?; 126 + 127 + version.id.clone() 128 ~ }; |
implicitly cloning a `String` by calling `to_owned` on its dereferenced type: src/app/from_string.rs#L103
warning: implicitly cloning a `String` by calling `to_owned` on its dereferenced type --> src/app/from_string.rs:103:30 | 103 | version: version.to_owned().to_owned(), | ^^^^^^^^^^^^^^^^^^ help: consider using: `version.clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
implicitly cloning a `String` by calling `to_owned` on its dereferenced type: src/app/from_string.rs#L103
warning: implicitly cloning a `String` by calling `to_owned` on its dereferenced type --> src/app/from_string.rs:103:30 | 103 | version: version.to_owned().to_owned(), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `version.to_owned().clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
calling `to_string` on `&&str`: src/app/from_string.rs#L77
warning: calling `to_string` on `&&str` --> src/app/from_string.rs:77:39 | 77 | ["version", v] => v.to_string(), | ^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*v).to_string()` | = help: `&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inefficient_to_string = note: `#[warn(clippy::inefficient_to_string)]` implied by `#[warn(clippy::pedantic)]`
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/app/from_string.rs#L76
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/app/from_string.rs:76:31 | 76 | let version = match rest { | _______________________________^ 77 | | ["version", v] => v.to_string(), 78 | | _ => { 79 | | let versions = self.modrinth().fetch_versions(id).await?; ... | 98 | | } 99 | | }; | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else help: try | 76 ~ let version = if let ["version", v] = rest { v.to_string() } else { 77 + let versions = self.modrinth().fetch_versions(id).await?; 78 + 79 + if versions.is_empty() { 80 + bail!("No compatible versions found"); 81 + } 82 + 83 + let version = self.select("Select a version", &versions.iter().map(|v| { 84 + SelectItem(v.clone(), if v.version_number == v.name { 85 + v.version_number.clone() 86 + } else { 87 + format!( 88 + "[{}] {}", 89 + v.version_number, 90 + v.name, 91 + ) 92 + }) 93 + }).collect::<Vec<_>>())?; 94 + 95 + version.id.clone() 96 ~ }; |
redundant closure: src/app/from_string.rs#L66
warning: redundant closure --> src/app/from_string.rs:66:54 | 66 | match (url.domain(), url.path_segments().map(|x| x.collect::<Vec<_>>()).unwrap_or_default().as_slice()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::iter::Iterator::collect` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls = note: `#[warn(clippy::redundant_closure_for_method_calls)]` implied by `#[warn(clippy::pedantic)]`
this function has too many lines (210/100): src/app/from_string.rs#L60
warning: this function has too many lines (210/100) --> src/app/from_string.rs:60:5 | 60 | / pub async fn dl_from_url( 61 | | &self, 62 | | urlstr: &str 63 | | ) -> Result<Downloadable> { ... | 313 | | } 314 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines
this function has too many lines (196/100): src/app/downloading.rs#L52
warning: this function has too many lines (196/100) --> src/app/downloading.rs:52:5 | 52 | / pub async fn download_resolved( 53 | | &self, 54 | | resolved: ResolvedFile, 55 | | destination: PathBuf, ... | 308 | | Ok(resolved) 309 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines = note: `#[warn(clippy::too_many_lines)]` implied by `#[warn(clippy::pedantic)]`
consider adding a `;` to the last statement for consistent formatting: src/app/downloading.rs#L29
warning: consider adding a `;` to the last statement for consistent formatting --> src/app/downloading.rs:29:13 | 29 | self.1() | ^^^^^^^^ help: add a `;` here: `self.1();` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned = note: `#[warn(clippy::semicolon_if_nothing_returned)]` implied by `#[warn(clippy::pedantic)]`
item in documentation is missing backticks: src/core/mod.rs#L108
warning: item in documentation is missing backticks --> src/core/mod.rs:108:14 | 108 | /// Save new_lockfile | ^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown help: try | 108 | /// Save `new_lockfile` | ~~~~~~~~~~~~~~
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/core/mod.rs#L91
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/core/mod.rs:91:25 | 91 | self.lockfile = match Lockfile::get_lockfile(&self.output_dir) { | _________________________^ 92 | | Ok(f) => f, 93 | | Err(_) => { 94 | | self.app.warn("Lockfile error, using default")?; ... | 99 | | }, 100 | | }; | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else = note: `#[warn(clippy::single_match_else)]` implied by `#[warn(clippy::pedantic)]` help: try | 91 ~ self.lockfile = if let Ok(f) = Lockfile::get_lockfile(&self.output_dir) { f } else { 92 + self.app.warn("Lockfile error, using default")?; 93 + Lockfile { 94 + path: self.output_dir.join(".mcman.lock"), 95 + ..Default::default() 96 + } 97 ~ }; |
item in documentation is missing backticks: src/core/mod.rs#L89
warning: item in documentation is missing backticks --> src/core/mod.rs:89:59 | 89 | /// Load to self.lockfile and create a default one at self.new_lockfile | ^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown = note: `#[warn(clippy::doc_markdown)]` implied by `#[warn(clippy::pedantic)]` help: try | 89 | /// Load to self.lockfile and create a default one at `self.new_lockfile` | ~~~~~~~~~~~~~~~~~~~
unused `self` argument: src/core/bootstrap.rs#L81
warning: unused `self` argument --> src/core/bootstrap.rs:81:34 | 81 | pub fn should_bootstrap_file(&self, path: &Path) -> bool { | ^^^^^ | = help: consider refactoring to an associated function = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self = note: `#[warn(clippy::unused_self)]` implied by `#[warn(clippy::pedantic)]`
usage of `FromIterator::from_iter`: src/core/bootstrap.rs#L26
warning: usage of `FromIterator::from_iter` --> src/core/bootstrap.rs:26:62 | 26 | let lockfile_entries: HashMap<PathBuf, SystemTime> = HashMap::from_iter(self.lockfile.files.iter() | ______________________________________________________________^ 27 | | .map(|e| (e.path.clone(), e.date.clone()))); | |_______________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_iter_instead_of_collect help: use `.collect()` instead of `::from_iter()` | 26 ~ let lockfile_entries: HashMap<PathBuf, SystemTime> = self.lockfile.files.iter() 27 ~ .map(|e| (e.path.clone(), e.date.clone())).collect::<HashMap<_, _>>(); |
usage of `FromIterator::from_iter`: src/core/addons.rs#L45
warning: usage of `FromIterator::from_iter` --> src/core/addons.rs:45:30 | 45 | let existing_files = HashSet::from_iter(match addon_type { | ______________________________^ 46 | | AddonType::Plugin => self.lockfile.plugins.iter(), 47 | | AddonType::Mod => self.lockfile.mods.iter(), 48 | | }.map(|(_, res)| res.filename.clone())); | |_______________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_iter_instead_of_collect = note: `#[warn(clippy::from_iter_instead_of_collect)]` implied by `#[warn(clippy::pedantic)]` help: use `.collect()` instead of `::from_iter()` | 45 ~ let existing_files = match addon_type { 46 + AddonType::Plugin => self.lockfile.plugins.iter(), 47 + AddonType::Mod => self.lockfile.mods.iter(), 48 + }.map(|(_, res)| res.filename.clone()).collect::<HashSet::from_iter(match addon_type { 49 + AddonType::Plugin => self.lockfile.plugins.iter(), 50 ~ AddonType<_>>(); |
called `map(<f>).unwrap_or(<a>)` on an `Option` value. This can be done more directly by calling `map_or(<a>, <f>)` instead: src/commands/world/unpack.rs#L55
warning: called `map(<f>).unwrap_or(<a>)` on an `Option` value. This can be done more directly by calling `map_or(<a>, <f>)` instead --> src/commands/world/unpack.rs:55:22 | 55 | let world_name = zipfile | ______________________^ 56 | | .file_name() 57 | | .map(|o| o.to_string_lossy().into_owned()) 58 | | .unwrap_or("world".to_owned()); | |______________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or = note: `#[warn(clippy::map_unwrap_or)]` implied by `#[warn(clippy::pedantic)]` help: use `map_or(<a>, <f>)` instead | 57 - .map(|o| o.to_string_lossy().into_owned()) 57 + .map_or("world".to_owned(), |o| o.to_string_lossy().into_owned()); |
case-sensitive file extension comparison: src/commands/world/unpack.rs#L17
warning: case-sensitive file extension comparison --> src/commands/world/unpack.rs:17:48 | 17 | app.server.path.join("worlds").join(if s.ends_with(".zip") { | ^^^^^^^^^^^^^^^^^^^ | = 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: `#[warn(clippy::case_sensitive_file_extension_comparisons)]` implied by `#[warn(clippy::pedantic)]` help: use std::path::Path | 17 ~ app.server.path.join("worlds").join(if std::path::Path::new(&s) 18 + .extension() 19 ~ .map_or(false, |ext| ext.eq_ignore_ascii_case("zip")) { |
implicitly cloning a `String` by calling `to_owned` on its dereferenced type: src/commands/add/modrinth.rs#L18
warning: implicitly cloning a `String` by calling `to_owned` on its dereferenced type --> src/commands/add/modrinth.rs:18:9 | 18 | s.to_owned() | ^^^^^^^^^^^^ help: consider using: `s.clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone = note: `#[warn(clippy::implicit_clone)]` implied by `#[warn(clippy::pedantic)]`
this argument is passed by value, but not consumed in the function body: src/commands/pull.rs#L19
warning: this argument is passed by value, but not consumed in the function body --> src/commands/pull.rs:19:17 | 19 | pub fn run(app: App, args: Args) -> Result<()> { | ^^^ help: consider taking a reference instead: `&App` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
this argument is passed by value, but not consumed in the function body: src/commands/info.rs#L7
warning: this argument is passed by value, but not consumed in the function body --> src/commands/info.rs:7:17 | 7 | pub fn run(app: App) -> Result<()> { | ^^^ help: consider taking a reference instead: `&App` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
this argument is passed by value, but not consumed in the function body: src/commands/env/mod.rs#L16
warning: this argument is passed by value, but not consumed in the function body --> src/commands/env/mod.rs:16:32 | 16 | pub fn run(app: App, commands: Commands) -> Result<()> { | ^^^^^^^^ help: consider taking a reference instead: `&Commands` | help: consider marking this type as `Copy` --> src/commands/env/mod.rs:9:1 | 9 | pub enum Commands { | ^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
this argument is passed by value, but not consumed in the function body: src/commands/env/gitignore.rs#L5
warning: this argument is passed by value, but not consumed in the function body --> src/commands/env/gitignore.rs:5:17 | 5 | pub fn run(app: App) -> Result<()> { | ^^^ help: consider taking a reference instead: `&App` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
this argument is passed by value, but not consumed in the function body: src/commands/env/docker.rs#L9
warning: this argument is passed by value, but not consumed in the function body --> src/commands/env/docker.rs:9:17 | 9 | pub fn run(app: App) -> Result<()> { | ^^^ help: consider taking a reference instead: `&App` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
this argument is passed by value, but not consumed in the function body: src/commands/eject.rs#L10
warning: this argument is passed by value, but not consumed in the function body --> src/commands/eject.rs:10:17 | 10 | pub fn run(app: App) -> Result<()> { | ^^^ help: consider taking a reference instead: `&App` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value note: the lint level is defined here --> src/main.rs:2:9 | 2 | #![warn(clippy::pedantic)] | ^^^^^^^^^^^^^^^^ = note: `#[warn(clippy::needless_pass_by_value)]` implied by `#[warn(clippy::pedantic)]`
variant `Stop` is never constructed: src/hot_reload/mod.rs#L24
warning: variant `Stop` is never constructed --> src/hot_reload/mod.rs:24:5 | 22 | pub enum Command { | ------- variant in this enum 23 | Start, 24 | Stop, | ^^^^
methods `to_mod` and `resolved_to_mod` are never used: src/interop/packwiz.rs#L178
warning: methods `to_mod` and `resolved_to_mod` are never used --> src/interop/packwiz.rs:178:18 | 39 | impl<'a> PackwizInterop<'a> { | --------------------------- methods in this implementation ... 178 | pub async fn to_mod(&self, dl: &Downloadable) -> Result<Mod> { | ^^^^^^ ... 186 | pub async fn resolved_to_mod(&self, resolved_file: &ResolvedFile) -> Result<Mod> { | ^^^^^^^^^^^^^^^
function `get_docker_version` is never used: src/util/env.rs#L102
warning: function `get_docker_version` is never used --> src/util/env.rs:102:8 | 102 | pub fn get_docker_version() -> Result<Option<String>> { | ^^^^^^^^^^^^^^^^^^
function `get_git_branch` is never used: src/util/env.rs#L82
warning: function `get_git_branch` is never used --> src/util/env.rs:82:8 | 82 | pub fn get_git_branch() -> Result<Option<String>> { | ^^^^^^^^^^^^^^
function `get_git_remote` is never used: src/util/env.rs#L34
warning: function `get_git_remote` is never used --> src/util/env.rs:34:8 | 34 | pub fn get_git_remote() -> Result<Option<String>> { | ^^^^^^^^^^^^^^
function `try_get_url` is never used: src/util/env.rs#L10
warning: function `try_get_url` is never used --> src/util/env.rs:10:8 | 10 | pub fn try_get_url(folder: &PathBuf) -> Result<String> { | ^^^^^^^^^^^
method `fetch_versions` is never used: src/sources/spigot.rs#L53
warning: method `fetch_versions` is never used --> src/sources/spigot.rs:53:18 | 21 | impl<'a> SpigotAPI<'a> { | ---------------------- method in this implementation ... 53 | pub async fn fetch_versions(&self, id: &str) -> Result<Vec<SpigotVersion>> { | ^^^^^^^^^^^^^^
method `fetch_versions` is never used: src/sources/purpur.rs#L26
warning: method `fetch_versions` is never used --> src/sources/purpur.rs:26:18 | 13 | impl<'a> PurpurAPI<'a> { | ---------------------- method in this implementation ... 26 | pub async fn fetch_versions(&self) -> Result<Vec<String>> { | ^^^^^^^^^^^^^^
methods `fetch_api` and `fetch_versions` are never used: src/sources/papermc.rs#L14
warning: methods `fetch_api` and `fetch_versions` are never used --> src/sources/papermc.rs:14:18 | 13 | impl<'a> PaperMCAPI<'a> { | ----------------------- methods in this implementation 14 | pub async fn fetch_api<T: DeserializeOwned + Clone + Serialize>( | ^^^^^^^^^ ... 31 | pub async fn fetch_versions(&self, project: &str) -> Result<Vec<String>> { | ^^^^^^^^^^^^^^
method `search` is never used: src/sources/modrinth.rs#L162
warning: method `search` is never used --> src/sources/modrinth.rs:162:18 | 105 | impl<'a> ModrinthAPI<'a> { | ------------------------ method in this implementation ... 162 | pub async fn search(&self, query: &str) -> Result<Vec<ModrinthProject>> { | ^^^^^^
function `get_jenkins_download_url` is never used: src/sources/jenkins.rs#L153
warning: function `get_jenkins_download_url` is never used --> src/sources/jenkins.rs:153:14 | 153 | pub async fn get_jenkins_download_url( | ^^^^^^^^^^^^^^^^^^^^^^^^
method `inner` is never used: src/model/lockfile/mod.rs#L39
warning: method `inner` is never used --> src/model/lockfile/mod.rs:39:12 | 38 | impl<T> Change<T> { | ----------------- method in this implementation 39 | pub fn inner(&self) -> &T { | ^^^^^
variants `Added` and `Removed` are never constructed: src/model/lockfile/mod.rs#L34
warning: variants `Added` and `Removed` are never constructed --> src/model/lockfile/mod.rs:34:5 | 33 | pub enum Change<T> { | ------ variants in this enum 34 | Added(T), | ^^^^^ 35 | Removed(T), | ^^^^^^^ | = note: `Change` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
method `get_type_name` is never used: src/model/servertype/meta.rs#L6
warning: method `get_type_name` is never used --> src/model/servertype/meta.rs:6:12 | 5 | impl ServerType { | --------------- method in this implementation 6 | pub fn get_type_name(&self) -> String { | ^^^^^^^^^^^^^
method `get_modrinth_facets` is never used: src/model/servertype/mod.rs#L234
warning: method `get_modrinth_facets` is never used --> src/model/servertype/mod.rs:234:12 | 98 | impl ServerType { | --------------- method in this implementation ... 234 | pub fn get_modrinth_facets(&self, mcver: &str) -> Result<String> { | ^^^^^^^^^^^^^^^^^^^
method `add_datapack` is never used: src/model/servertoml/interactive.rs#L9
warning: method `add_datapack` is never used --> src/model/servertoml/interactive.rs:9:12 | 8 | impl Server { | ----------- method in this implementation 9 | pub fn add_datapack(&mut self, dl: Downloadable) -> Result<String> { | ^^^^^^^^^^^^
associated function `hash_sha256` is never used: src/app/hashing.rs#L18
warning: associated function `hash_sha256` is never used --> src/app/hashing.rs:18:12 | 8 | impl App { | -------- associated function in this implementation ... 18 | pub fn hash_sha256(contents: &str) -> String { | ^^^^^^^^^^^
associated items `new` and `has_in_cache` are never used: src/app/mod.rs#L92
warning: associated items `new` and `has_in_cache` are never used --> src/app/mod.rs:92:12 | 91 | impl App { | -------- associated items in this implementation 92 | pub fn new() -> Result<Self> { | ^^^ ... 130 | pub fn has_in_cache(&self, ns: &str, path: &str) -> bool { | ^^^^^^^^^^^^
methods `process_worlds`, `process_world`, `world_source_exists`, `world_exists_in_output`, and `process_datapacks` are never used: src/core/worlds.rs#L11
warning: methods `process_worlds`, `process_world`, `world_source_exists`, `world_exists_in_output`, and `process_datapacks` are never used --> src/core/worlds.rs:11:18 | 10 | impl<'a> BuildContext<'a> { | ------------------------- methods in this implementation 11 | pub async fn process_worlds(&self) -> Result<()> { | ^^^^^^^^^^^^^^ ... 29 | pub async fn process_world( | ^^^^^^^^^^^^^ ... 76 | pub fn world_source_exists( | ^^^^^^^^^^^^^^^^^^^ ... 83 | pub fn world_exists_in_output( | ^^^^^^^^^^^^^^^^^^^^^^ ... 96 | pub async fn process_datapacks( | ^^^^^^^^^^^^^^^^^
methods `run` and `pipe_child_process` are never used: src/core/runner.rs#L18
warning: methods `run` and `pipe_child_process` are never used --> src/core/runner.rs:18:12 | 17 | impl<'a> BuildContext<'a> { | ------------------------- methods in this implementation 18 | pub fn run(&mut self, test_mode: bool) -> Result<()> { | ^^^ ... 52 | pub async fn pipe_child_process(&mut self, test_mode: bool) -> Result<ExitStatus> { | ^^^^^^^^^^^^^^^^^^
function `initialize_readme` is never used: src/commands/markdown.rs#L31
warning: function `initialize_readme` is never used --> src/commands/markdown.rs:31:8 | 31 | pub fn initialize_readme(server: &Server) -> Result<()> { | ^^^^^^^^^^^^^^^^^
function `initialize_environment` is never used: src/commands/init/mod.rs#L174
warning: function `initialize_environment` is never used --> src/commands/init/mod.rs:174:8 | 174 | pub fn initialize_environment(is_proxy: bool) -> Result<()> { | ^^^^^^^^^^^^^^^^^^^^^^
function `init_final` is never used: src/commands/init/mod.rs#L132
warning: function `init_final` is never used --> src/commands/init/mod.rs:132:14 | 132 | pub async fn init_final( | ^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default
unused variable: `args`: src/model/servertype/mod.rs#L332
warning: unused variable: `args` --> src/model/servertype/mod.rs:332:48 | 332 | ServerType::BuildTools { software, args } => buildtools().resolve_source(app).await, | ^^^^ help: try ignoring the field: `args: _`
unused variable: `software`: src/model/servertype/mod.rs#L332
warning: unused variable: `software` --> src/model/servertype/mod.rs:332:38 | 332 | ServerType::BuildTools { software, args } => buildtools().resolve_source(app).await, | ^^^^^^^^ help: try ignoring the field: `software: _`
unused variable: `loader`: src/model/servertype/mod.rs#L329
warning: unused variable: `loader` --> src/model/servertype/mod.rs:329:33 | 329 | ServerType::Quilt { loader, installer } => app.quilt().resolve_installer(installer).await, | ^^^^^^ help: try ignoring the field: `loader: _`
unused variable: `args`: src/model/servertype/mod.rs#L309
warning: unused variable: `args` --> src/model/servertype/mod.rs:309:48 | 309 | ServerType::BuildTools { software, args } => format!("(BuildTools) {software}"), | ^^^^ help: try ignoring the field: `args: _`
unused variable: `installer`: src/model/servertype/mod.rs#L306
warning: unused variable: `installer` --> src/model/servertype/mod.rs:306:41 | 306 | ServerType::Quilt { loader, installer } => format!("Quilt v{loader}"), | ^^^^^^^^^ help: try ignoring the field: `installer: _`
unused variable: `installer`: src/model/servertype/mod.rs#L305
warning: unused variable: `installer` --> src/model/servertype/mod.rs:305:42 | 305 | ServerType::Fabric { loader, installer } => format!("Fabric v{loader}"), | ^^^^^^^^^ help: try ignoring the field: `installer: _`
unused variable: `test_mode`: src/core/runner.rs#L18
warning: unused variable: `test_mode` --> src/core/runner.rs:18:27 | 18 | pub fn run(&mut self, test_mode: bool) -> Result<()> { | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_test_mode`
variable `skipped` is assigned to, but never used: src/commands/pull.rs#L28
warning: variable `skipped` is assigned to, but never used --> src/commands/pull.rs:28:13 | 28 | let mut skipped = 0; | ^^^^^^^ | = note: consider using `_skipped` instead
unused variable: `query`: src/commands/add/modrinth.rs#L17
warning: unused variable: `query` --> src/commands/add/modrinth.rs:17:9 | 17 | let query = if let Some(s) = args.search { | ^^^^^ help: if this is intentional, prefix it with an underscore: `_query`
unreachable expression: src/commands/add/modrinth.rs#L165
warning: unreachable expression --> src/commands/add/modrinth.rs:165:5 | 23 | todo!(); | ------- any code following this expression is unreachable ... 165 | Ok(()) | ^^^^^^ unreachable expression
unused variable: `test_mode`: src/commands/run.rs#L17
warning: unused variable: `test_mode` --> src/commands/run.rs:17:9 | 17 | let test_mode = args.test; | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_test_mode`
unused variable: `ctx`: src/commands/run.rs#L15
warning: unused variable: `ctx` --> src/commands/run.rs:15:13 | 15 | let mut ctx = super::build::run(app, args.build_args).await?; | ^^^ help: if this is intentional, prefix it with an underscore: `_ctx`
unused variable: `cf_usecdn`: src/commands/export/packwiz.rs#L21
warning: unused variable: `cf_usecdn` --> src/commands/export/packwiz.rs:21:9 | 21 | let cf_usecdn = args.cfcdn; | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_cf_usecdn`
unused variable: `output_dir`: src/commands/export/packwiz.rs#L19
warning: unused variable: `output_dir` --> src/commands/export/packwiz.rs:19:9 | 19 | let output_dir = args.output.unwrap_or(default_output); | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_output_dir` | = note: `#[warn(unused_variables)]` on by default
unreachable expression: src/commands/export/packwiz.rs#L25
warning: unreachable expression --> src/commands/export/packwiz.rs:25:5 | 23 | todo!(); | ------- any code following this expression is unreachable 24 | 25 | Ok(()) | ^^^^^^ unreachable expression | = note: `#[warn(unreachable_code)]` on by default
unused import: `commands`: src/model/servertoml/mod.rs#L12
warning: unused import: `commands` --> src/model/servertoml/mod.rs:12:13 | 12 | use crate::{commands, sources::modrinth}; | ^^^^^^^^
unused import: `Context`: src/model/servertoml/mod.rs#L9
warning: unused import: `Context` --> src/model/servertoml/mod.rs:9:28 | 9 | use anyhow::{anyhow, bail, Context, Result}; | ^^^^^^^
unused import: `console::style`: src/core/scripts.rs#L4
warning: unused import: `console::style` --> src/core/scripts.rs:4:5 | 4 | use console::style; | ^^^^^^^^^^^^^^
unused import: `crate::app::App`: src/core/runner.rs#L13
warning: unused import: `crate::app::App` --> src/core/runner.rs:13:5 | 13 | use crate::app::App; | ^^^^^^^^^^^^^^^
unused imports: `RwLock`, `mpsc`: src/core/runner.rs#L11
warning: unused imports: `RwLock`, `mpsc` --> src/core/runner.rs:11:28 | 11 | use tokio::sync::{oneshot, RwLock, mpsc}; | ^^^^^^ ^^^^
unused imports: `ChildStderr`, `ChildStdin`, `ChildStdout`, `Child`, `Stdio`: src/core/runner.rs#L3
warning: unused imports: `ChildStderr`, `ChildStdin`, `ChildStdout`, `Child`, `Stdio` --> src/core/runner.rs:3:27 | 3 | process::{ExitStatus, Stdio, Child, ChildStdin, ChildStdout, ChildStderr}, | ^^^^^ ^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^
unused import: `Context`: src/core/addons.rs#L3
warning: unused import: `Context` --> src/core/addons.rs:3:14 | 3 | use anyhow::{Context, Result}; | ^^^^^^^
unused imports: `Downloadable`, `Server`, `SoftwareType`, `sources::modrinth`, `util::SelectItem`: src/commands/add/modrinth.rs#L6
warning: unused imports: `Downloadable`, `Server`, `SoftwareType`, `sources::modrinth`, `util::SelectItem` --> src/commands/add/modrinth.rs:6:13 | 6 | model::{Downloadable, Server, SoftwareType}, | ^^^^^^^^^^^^ ^^^^^^ ^^^^^^^^^^^^ 7 | sources::modrinth, | ^^^^^^^^^^^^^^^^^ 8 | util::SelectItem, app::App, | ^^^^^^^^^^^^^^^^
unused imports: `Input`, `Select`, `theme::ColorfulTheme`: src/commands/add/modrinth.rs#L3
warning: unused imports: `Input`, `Select`, `theme::ColorfulTheme` --> src/commands/add/modrinth.rs:3:17 | 3 | use dialoguer::{theme::ColorfulTheme, Input, Select}; | ^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^^^^^
unused import: `console::style`: src/commands/add/modrinth.rs#L2
warning: unused import: `console::style` --> src/commands/add/modrinth.rs:2:5 | 2 | use console::style; | ^^^^^^^^^^^^^^
unused imports: `Context`, `bail`: src/commands/add/modrinth.rs#L1
warning: unused imports: `Context`, `bail` --> src/commands/add/modrinth.rs:1:14 | 1 | use anyhow::{bail, Context, Result}; | ^^^^ ^^^^^^^
unused imports: `Context`, `anyhow`: src/commands/run.rs#L1
warning: unused imports: `Context`, `anyhow` --> src/commands/run.rs:1:14 | 1 | use anyhow::{anyhow, Context, Result}; | ^^^^^^ ^^^^^^^
unused imports: `Downloadable`, `Server`: src/commands/import/datapack.rs#L6
warning: unused imports: `Downloadable`, `Server` --> src/commands/import/datapack.rs:6:13 | 6 | model::{Downloadable, Server}, app::App, | ^^^^^^^^^^^^ ^^^^^^
unused import: `dialoguer::Input`: src/commands/import/datapack.rs#L3
warning: unused import: `dialoguer::Input` --> src/commands/import/datapack.rs:3:5 | 3 | use dialoguer::Input; | ^^^^^^^^^^^^^^^^
unused import: `console::style`: src/commands/import/datapack.rs#L2
warning: unused import: `console::style` --> src/commands/import/datapack.rs:2:5 | 2 | use console::style; | ^^^^^^^^^^^^^^
unused import: `Context`: src/commands/import/datapack.rs#L1
warning: unused import: `Context` --> src/commands/import/datapack.rs:1:14 | 1 | use anyhow::{Context, Result}; | ^^^^^^^
unused import: `Context`: src/commands/export/packwiz.rs#L3
warning: unused import: `Context` --> src/commands/export/packwiz.rs:3:14 | 3 | use anyhow::{Context, Result}; | ^^^^^^^
unused import: `model::Server`: src/commands/env/docker.rs#L5
warning: unused import: `model::Server` --> src/commands/env/docker.rs:5:5 | 5 | model::Server, | ^^^^^^^^^^^^^
unused import: `console::style`: src/commands/env/docker.rs#L2
warning: unused import: `console::style` --> src/commands/env/docker.rs:2:5 | 2 | use console::style; | ^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
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/