thingies #250
Annotations
66 errors and 208 warnings
useless conversion to the same type: `std::path::PathBuf`:
src/main.rs#L71
error: useless conversion to the same type: `std::path::PathBuf`
--> src/main.rs:71:17
|
71 | base.into(),
| ^^^^^^^^^^^ help: consider removing `.into()`: `base`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
|
useless use of `format!`:
src/commands/migrate.rs#L120
error: useless use of `format!`
--> src/commands/migrate.rs:120:26
|
120 | .with_context(|| format!("Writing server.toml"))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Writing server.toml".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
|
useless use of `format!`:
src/commands/migrate.rs#L72
error: useless use of `format!`
--> src/commands/migrate.rs:72:26
|
72 | .with_context(|| format!("Writing addons.toml"))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Writing addons.toml".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
|
redundant pattern matching, consider using `is_err()`:
src/api/ws/mod.rs#L72
error: redundant pattern matching, consider using `is_err()`
--> src/api/ws/mod.rs:72:20
|
72 | if let Err(_) = client.send(msg.clone()).await {
| -------^^^^^^--------------------------------- help: try: `if (client.send(msg.clone()).await).is_err()`
|
= note: this will change drop order of the result, as well as all temporaries
= note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
= note: `-D clippy::redundant-pattern-matching` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::redundant_pattern_matching)]`
|
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true:
src/api/ws/msg.rs#L37
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> src/api/ws/msg.rs:37:1
|
37 | impl Into<Message> for MsgOut {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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<api::ws::msg::MsgOut>`
|
37 ~ impl From<MsgOut> for Message {
38 ~ fn from(val: MsgOut) -> Self {
39 ~ Message::text(serde_json::to_string(&val).unwrap())
|
|
large size difference between variants:
src/api/ws/msg.rs#L26
error: large size difference between variants
--> src/api/ws/msg.rs:26:1
|
26 | / pub enum MsgOut {
27 | | / Connected {
28 | | | version: String,
29 | | | },
| | |_____- the second-largest variant contains at least 24 bytes
30 | |
31 | | / AppInfo {
32 | | | server: Option<Server>,
33 | | | network: Option<Network>,
34 | | | },
| | |_____- the largest variant contains at least 760 bytes
35 | | }
| |___^ the entire enum is at least 760 bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
= note: `-D clippy::large-enum-variant` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::large_enum_variant)]`
help: consider boxing the large fields to reduce the total size of the enum
|
32 | server: Box<Option<Server>>,
| ~~~~~~~~~~~~~~~~~~~
|
the borrowed expression implements the required traits:
src/api/utils/toml.rs#L27
error: the borrowed expression implements the required traits
--> src/api/utils/toml.rs:27:59
|
27 | let data: T = toml::from_str(&std::fs::read_to_string(&path)?)?;
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
redundant guard:
src/api/utils/pathdiff.rs#L90
error: redundant guard
--> src/api/utils/pathdiff.rs:90:39
|
90 | (Some(_), Some(b)) if b == Component::ParentDir => return None,
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards
help: try
|
90 - (Some(_), Some(b)) if b == Component::ParentDir => return None,
90 + (Some(_), Some(Component::ParentDir)) => return None,
|
|
redundant guard:
src/api/utils/pathdiff.rs#L89
error: redundant guard
--> src/api/utils/pathdiff.rs:89:39
|
89 | (Some(a), Some(b)) if b == Component::CurDir => comps.push(a),
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards
= note: `-D clippy::redundant-guards` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::redundant_guards)]`
help: try
|
89 - (Some(a), Some(b)) if b == Component::CurDir => comps.push(a),
89 + (Some(a), Some(Component::CurDir)) => comps.push(a),
|
|
using `clone` on type `HashFormat` which implements the `Copy` trait:
src/api/utils/hashing/mod.rs#L58
error: using `clone` on type `HashFormat` which implements the `Copy` trait
--> src/api/utils/hashing/mod.rs:58:24
|
58 | .map(|(k, v)| (k.clone(), v.clone()))
| ^^^^^^^^^ help: try dereferencing it: `*k`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
direct implementation of `ToString`:
src/api/utils/accessor.rs#L18
error: direct implementation of `ToString`
--> src/api/utils/accessor.rs:18:1
|
18 | / impl ToString for Accessor {
19 | | fn to_string(&self) -> String {
20 | | match self {
21 | | Accessor::Local(path) => path.to_string_lossy().into_owned(),
... |
25 | | }
26 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
|
redundant closure:
src/api/tools/git/mod.rs#L7
error: redundant closure
--> src/api/tools/git/mod.rs:7:62
|
7 | static GIT_VERSION: LazyLock<Option<String>> = LazyLock::new(|| version_check());
| ^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `version_check`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
= note: `-D clippy::redundant-closure` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::redundant_closure)]`
|
current MSRV (Minimum Supported Rust Version) is `1.75.0` but this item is stable since `1.80.0`:
src/api/tools/git/mod.rs#L7
error: current MSRV (Minimum Supported Rust Version) is `1.75.0` but this item is stable since `1.80.0`
--> src/api/tools/git/mod.rs:7:48
|
7 | static GIT_VERSION: LazyLock<Option<String>> = LazyLock::new(|| version_check());
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
= note: `-D clippy::incompatible-msrv` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::incompatible_msrv)]`
|
useless use of `format!`:
src/api/tools/java/mod.rs#L46
error: useless use of `format!`
--> src/api/tools/java/mod.rs:46:30
|
46 | .with_context(|| format!("Spawning java process"))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Spawning java process".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
|
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`:
src/api/tools/java/installation.rs#L50
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`
--> src/api/tools/java/installation.rs:50:10
|
50 | .into_iter()
| ^^^^^^^^^ help: call directly: `iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
|
writing `&Vec` instead of `&[_]` involves a new object where a slice will do:
src/api/sources/buildtools/mod.rs#L58
error: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/api/sources/buildtools/mod.rs:58:18
|
58 | custom_args: &Vec<String>,
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
help: change this to
|
58 ~ custom_args: &[String],
59 | mc_version: &str,
...
75 |
76 ~ args.extend(custom_args.to_owned());
|
|
writing `&Vec` instead of `&[_]` involves a new object where a slice will do:
src/api/sources/buildtools/mod.rs#L32
error: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/api/sources/buildtools/mod.rs:32:19
|
32 | _custom_args: &Vec<String>,
| ^^^^^^^^^^^^ help: change this to: `&[String]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
|
question mark operator is useless here:
src/api/sources/spigot/mod.rs#L23
error: question mark operator is useless here
--> src/api/sources/spigot/mod.rs:23:9
|
23 | Ok(self.0.http_get_json(format!("{}/{url}", self.0.options.api_urls.spiget)).await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.http_get_json(format!("{}/{url}", self.0.options.api_urls.spiget)).await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
empty doc comment:
src/api/sources/hangar/models.rs#L268
error: empty doc comment
--> src/api/sources/hangar/models.rs:268:1
|
268 | ///
| ^^^
|
= help: consider removing or filling it
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs
= note: `-D clippy::empty-docs` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::empty_docs)]`
|
direct implementation of `ToString`:
src/api/sources/hangar/models.rs#L180
error: direct implementation of `ToString`
--> src/api/sources/hangar/models.rs:180:1
|
180 | / impl ToString for Platform {
181 | | fn to_string(&self) -> String {
182 | | match self {
183 | | Self::Paper => "PAPER".to_owned(),
... |
187 | | }
188 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
|
direct implementation of `ToString`:
src/api/sources/hangar/models.rs#L12
error: direct implementation of `ToString`
--> src/api/sources/hangar/models.rs:12:1
|
12 | / impl ToString for Namespace {
13 | | fn to_string(&self) -> String {
14 | | format!("{}/{}", self.owner, self.slug)
15 | | }
16 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/api/sources/papermc/mod.rs#L71
error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/api/sources/papermc/mod.rs:71:56
|
71 | let resolved_build = self.fetch_build(project, &version, build).await?;
| ^^^^^^^^ help: change this to: `version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
methods called `into_*` usually take `self` by value:
src/api/sources/vanilla/mod.rs#L20
error: methods called `into_*` usually take `self` by value
--> src/api/sources/vanilla/mod.rs:20:22
|
20 | pub fn into_step(&self, ty: DownloadType) -> Option<Vec<Step>> {
| ^^^^^
|
= 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
|
useless conversion to the same type: `std::string::String`:
src/api/sources/url/mod.rs#L25
error: useless conversion to the same type: `std::string::String`
--> src/api/sources/url/mod.rs:25:14
|
25 | url: url.into(),
| ^^^^^^^^^^ help: consider removing `.into()`: `url`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `-D clippy::useless-conversion` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::useless_conversion)]`
|
called `map(..).flatten()` on `Option`:
src/api/sources/modrinth/mod.rs#L63
error: called `map(..).flatten()` on `Option`
--> src/api/sources/modrinth/mod.rs:63:42
|
63 | if let Some(id) = store.as_ref().map(|ids| ids.get(slug)).flatten() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|ids| ids.get(slug))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `-D clippy::map-flatten` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::map_flatten)]`
|
question mark operator is useless here:
src/api/sources/modrinth/mod.rs#L43
error: question mark operator is useless here
--> src/api/sources/modrinth/mod.rs:43:9
|
43 | Ok(self.fetch_all_versions(id).await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.fetch_all_versions(id).await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true:
src/api/sources/curseforge/mod.rs#L86
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> src/api/sources/curseforge/mod.rs:86:1
|
86 | impl Into<HashFormat> for CurseforgeHashAlgo {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
= note: `-D clippy::from-over-into` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::from_over_into)]`
help: replace the `Into` implementation with `From<api::sources::curseforge::models::CurseforgeHashAlgo>`
|
86 ~ impl From<CurseforgeHashAlgo> for HashFormat {
87 ~ fn from(val: CurseforgeHashAlgo) -> Self {
88 ~ match val {
|
|
struct update has no effect, all the fields in the struct have already been specified:
src/api/sources/curseforge/mod.rs#L67
error: struct update has no effect, all the fields in the struct have already been specified
--> src/api/sources/curseforge/mod.rs:67:15
|
67 | ..Default::default()
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update
|
struct update has no effect, all the fields in the struct have already been specified:
src/api/sources/curseforge/mod.rs#L50
error: struct update has no effect, all the fields in the struct have already been specified
--> src/api/sources/curseforge/mod.rs:50:15
|
50 | ..Default::default()
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update
= note: `-D clippy::needless-update` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::needless_update)]`
|
methods called `into_*` usually take `self` by value:
src/api/models/metadata/addon_metadata.rs#L41
error: methods called `into_*` usually take `self` by value
--> src/api/models/metadata/addon_metadata.rs:41:21
|
41 | pub fn into_str(&self) -> &'static str {
| ^^^^^
|
= 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
|
direct implementation of `ToString`:
src/api/models/markdown/mod.rs#L64
error: direct implementation of `ToString`
--> src/api/models/markdown/mod.rs:64:1
|
64 | / impl ToString for MdColumn {
65 | | fn to_string(&self) -> String {
66 | | match self {
67 | | MdColumn::Icon => String::from("."),
... |
73 | | }
74 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
|
name `HTML` contains a capitalized acronym:
src/api/models/markdown/mod.rs#L14
error: name `HTML` contains a capitalized acronym
--> src/api/models/markdown/mod.rs:14:5
|
14 | HTML,
| ^^^^ help: consider making the acronym lowercase, except the initial letter: `Html`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
|
name `ASCII` contains a capitalized acronym:
src/api/models/markdown/mod.rs#L13
error: name `ASCII` contains a capitalized acronym
--> src/api/models/markdown/mod.rs:13:5
|
13 | ASCII,
| ^^^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Ascii`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
= note: `-D clippy::upper-case-acronyms` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::upper_case_acronyms)]`
|
using `clone` on type `ServerFlavor` which implements the `Copy` trait:
src/api/models/server/server_type.rs#L146
error: using `clone` on type `ServerFlavor` which implements the `Copy` trait
--> src/api/models/server/server_type.rs:146:50
|
146 | ServerType::Custom { flavor, .. } => flavor.clone(),
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*flavor`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
direct implementation of `ToString`:
src/api/models/server/server_type.rs#L24
error: direct implementation of `ToString`
--> src/api/models/server/server_type.rs:24:1
|
24 | / impl ToString for PaperMCProject {
25 | | fn to_string(&self) -> String {
26 | | match self {
27 | | Self::Paper => "paper".to_owned(),
... |
31 | | }
32 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
|
match expression looks like `matches!` macro:
src/api/models/server/server_flavor.rs#L46
error: match expression looks like `matches!` macro
--> src/api/models/server/server_flavor.rs:46:9
|
46 | / match self {
47 | | ServerFlavor::Patched => true,
48 | | _ => false,
49 | | }
| |_________^ help: try: `matches!(self, ServerFlavor::Patched)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
|
match expression looks like `matches!` macro:
src/api/models/server/server_flavor.rs#L39
error: match expression looks like `matches!` macro
--> src/api/models/server/server_flavor.rs:39:9
|
39 | / match self {
40 | | ServerFlavor::Proxy => false,
41 | | _ => true,
42 | | }
| |_________^ help: try: `!matches!(self, ServerFlavor::Proxy)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
|
match expression looks like `matches!` macro:
src/api/models/server/server_flavor.rs#L23
error: match expression looks like `matches!` macro
--> src/api/models/server/server_flavor.rs:23:9
|
23 | / match self {
24 | | ServerFlavor::Modded => true,
25 | | _ => false,
26 | | }
| |_________^ help: try: `matches!(self, ServerFlavor::Modded)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
|
match expression looks like `matches!` macro:
src/api/models/server/server_flavor.rs#L16
error: match expression looks like `matches!` macro
--> src/api/models/server/server_flavor.rs:16:9
|
16 | / match self {
17 | | ServerFlavor::Proxy => false,
18 | | _ => true,
19 | | }
| |_________^ help: try: `!matches!(self, ServerFlavor::Proxy)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
= note: `-D clippy::match-like-matches-macro` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::match_like_matches_macro)]`
|
methods called `into_*` usually take `self` by value:
src/api/models/packwiz/mod.rs#L72
error: methods called `into_*` usually take `self` by value
--> src/api/models/packwiz/mod.rs:72:29
|
72 | pub async fn into_addon(&self, app: &App, target: AddonTarget) -> Result<Addon> {
| ^^^^^
|
= 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
|
writing `&Vec` instead of `&[_]` involves a new object where a slice will do:
src/api/models/packwiz/mod.rs#L51
error: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/api/models/packwiz/mod.rs:51:36
|
51 | pub async fn from_steps(steps: &Vec<Step>) -> Self {
| ^^^^^^^^^^ help: change this to: `&[Step]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `-D clippy::ptr-arg` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::ptr_arg)]`
|
question mark operator is useless here:
src/api/models/packwiz/mod.rs#L19
error: question mark operator is useless here
--> src/api/models/packwiz/mod.rs:19:5
|
19 | Ok(ServerJar::try_from(pack.versions.clone())?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `ServerJar::try_from(pack.versions.clone())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
methods called `into_*` usually take `self` by value:
src/api/models/mrpack/mod.rs#L35
error: methods called `into_*` usually take `self` by value
--> src/api/models/mrpack/mod.rs:35:29
|
35 | pub async fn into_addon(&self) -> Result<Addon> {
| ^^^^^
|
= 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: `-D clippy::wrong-self-convention` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::wrong_self_convention)]`
|
question mark operator is useless here:
src/api/models/mrpack/mod.rs#L19
error: question mark operator is useless here
--> src/api/models/mrpack/mod.rs:19:5
|
19 | Ok(ServerJar::try_from(index.dependencies.clone())?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `ServerJar::try_from(index.dependencies.clone())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
this `impl` can be derived:
src/api/models/lockfile/mod.rs#L18
error: this `impl` can be derived
--> src/api/models/lockfile/mod.rs:18:1
|
18 | / impl Default for Lockfile {
19 | | fn default() -> Self {
20 | | Self {
21 | | addons: vec![],
... |
25 | | }
26 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: `-D clippy::derivable-impls` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::derivable_impls)]`
= help: remove the manual implementation...
help: ...and instead derive it
|
12 + #[derive(Default)]
13 | pub struct Lockfile {
|
|
direct implementation of `ToString`:
src/api/models/addon/addon_type.rs#L61
error: direct implementation of `ToString`
--> src/api/models/addon/addon_type.rs:61:1
|
61 | / impl ToString for AddonType {
62 | | fn to_string(&self) -> String {
63 | | match self {
64 | | AddonType::Url { url } => format!("Url [{url}]"),
... |
73 | | }
74 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
|
module has the same name as its containing module:
src/api/models/addon/mod.rs#L1
error: module has the same name as its containing module
--> src/api/models/addon/mod.rs:1:1
|
1 | mod addon;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
= note: `-D clippy::module-inception` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::module_inception)]`
|
using `clone` on type `ModpackType` which implements the `Copy` trait:
src/api/models/source.rs#L71
error: using `clone` on type `ModpackType` which implements the `Copy` trait
--> src/api/models/source.rs:71:62
|
71 | SourceType::Modpack { modpack_type, .. } => Some(modpack_type.clone()),
| ^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*modpack_type`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `-D clippy::clone-on-copy` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::clone_on_copy)]`
|
direct implementation of `ToString`:
src/api/models/modpack_type.rs#L12
error: direct implementation of `ToString`
--> src/api/models/modpack_type.rs:12:1
|
12 | / impl ToString for ModpackType {
13 | | fn to_string(&self) -> String {
14 | | match self {
15 | | ModpackType::Packwiz => String::from("Packwiz"),
... |
19 | | }
20 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
|
question mark operator is useless here:
src/api/models/modpack_source.rs#L46
error: question mark operator is useless here
--> src/api/models/modpack_source.rs:46:9
|
46 | Ok(Accessor::from(str).with_context(|| "Creating Accessor")?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `Accessor::from(str).with_context(|| "Creating Accessor")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
direct implementation of `ToString`:
src/api/models/env.rs#L16
error: direct implementation of `ToString`
--> src/api/models/env.rs:16:1
|
16 | / impl ToString for Environment {
17 | | fn to_string(&self) -> String {
18 | | match self {
19 | | Environment::Both => String::from("both"),
... |
23 | | }
24 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
= note: `-D clippy::to-string-trait-impl` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::to_string_trait_impl)]`
|
useless use of `format!`:
src/api/app/step/mod.rs#L40
error: useless use of `format!`
--> src/api/app/step/mod.rs:40:38
|
40 | .with_context(|| format!("Downloading a file"))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Downloading a file".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
= note: `-D clippy::useless-format` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::useless_format)]`
|
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`:
src/api/app/step/execute_java.rs#L19
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`
--> src/api/app/step/execute_java.rs:19:14
|
19 | .into_iter()
| ^^^^^^^^^ help: call directly: `iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
= note: `-D clippy::into-iter-on-ref` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::into_iter_on_ref)]`
|
the borrowed expression implements the required traits:
src/api/app/step/download.rs#L49
error: the borrowed expression implements the required traits
--> src/api/app/step/download.rs:49:36
|
49 | let hash = hex::encode(&hasher.finalize());
| ^^^^^^^^^^^^^^^^^^ help: change this to: `hasher.finalize()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/api/app/step/download.rs#L34
error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/api/app/step/download.rs:34:24
|
34 | create_parents(&target_destination).await?;
| ^^^^^^^^^^^^^^^^^^^ help: change this to: `target_destination`
|
= 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/api/app/step/cache_check.rs#L128
error: the borrowed expression implements the required traits
--> src/api/app/step/cache_check.rs:128:36
|
128 | let hash = hex::encode(&hasher.finalize());
| ^^^^^^^^^^^^^^^^^^ help: change this to: `hasher.finalize()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/api/app/step/cache_check.rs#L62
error: the borrowed expression implements the required traits
--> src/api/app/step/cache_check.rs:62:44
|
62 | let hash = hex::encode(&hasher.finalize());
| ^^^^^^^^^^^^^^^^^^ help: change this to: `hasher.finalize()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `-D clippy::needless-borrows-for-generic-args` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::needless_borrows_for_generic_args)]`
|
question mark operator is useless here:
src/api/app/http.rs#L65
error: question mark operator is useless here
--> src/api/app/http.rs:65:9
|
65 | / Ok(serde_json::from_slice(&full)
66 | | .with_context(|| format!("JSON parsing error: {}", String::from_utf8_lossy(&full)))?)
| |_________________________________________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `-D clippy::needless-question-mark` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::needless_question_mark)]`
help: try removing question mark and `Ok()`
|
65 ~ serde_json::from_slice(&full)
66 + .with_context(|| format!("JSON parsing error: {}", String::from_utf8_lossy(&full)))
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/api/app/collect.rs#L47
error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/api/app/collect.rs:47:61
|
47 | addons.extend_from_slice(&source.resolve_addons(&self, &relative_to).await?);
| ^^^^^ help: change this to: `self`
|
= 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/api/app/actions/build/bootstrap.rs#L55
error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/api/app/actions/build/bootstrap.rs:55:88
|
55 | app.action_bootstrap_file(&output_base, &input_base, entry.path(), &changed_variables)
| ^^^^^^^^^^^^^^^^^^ help: change this to: `changed_variables`
|
= 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/api/app/actions/build/server_jar.rs#L15
error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/api/app/actions/build/server_jar.rs:15:43
|
15 | let steps = jar.resolve_steps(&self, Environment::Server).await?;
| ^^^^^ help: change this to: `self`
|
= 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/api/app/actions/build/server_jar.rs#L13
error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/api/app/actions/build/server_jar.rs:13:38
|
13 | let jar = server.get_jar(&self).await?;
| ^^^^^ help: change this to: `self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `-D clippy::needless-borrow` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::needless_borrow)]`
|
lint group `pedantic` has the same priority (0) as a lint:
Cargo.toml#L24
error: lint group `pedantic` has the same priority (0) as a lint
--> Cargo.toml:24:1
|
24 | pedantic = "warn"
| ^^^^^^^^ ------ has an implicit priority of 0
25 | missing_docs_in_private_items = "allow"
| ----------------------------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
help: to have lints override the group set `pedantic` to a lower priority
|
24 | pedantic = { level = "warn", priority = -1 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
lint group `all` has the same priority (0) as a lint:
Cargo.toml#L23
error: lint group `all` has the same priority (0) as a lint
--> Cargo.toml:23:1
|
23 | all = "deny"
| ^^^ ------ has an implicit priority of 0
24 | pedantic = "warn"
25 | missing_docs_in_private_items = "allow"
| ----------------------------- has the same priority as this lint
|
= note: the order of the lints in the table is ignored by Cargo
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lint_groups_priority
= note: `-D clippy::lint-groups-priority` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::lint_groups_priority)]`
help: to have lints override the group set `all` to a lower priority
|
23 | all = { level = "deny", priority = -1 }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
unneeded unit return type:
src/api/tools/java/mod.rs#L55
error: unneeded unit return type
--> src/api/tools/java/mod.rs:55:37
|
55 | pub fn lines<F>(&mut self, f: F) -> ()
| ^^^^^^ help: remove the `-> ()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
= note: `-D clippy::unused-unit` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::unused_unit)]`
|
clippy
Clippy had exited with the 101 exit code
|
unused `async` for function with no await statements:
src/commands/export/packwiz.rs#L12
warning: unused `async` for function with no await statements
--> src/commands/export/packwiz.rs:12:1
|
12 | / pub async fn run(app: Arc<App>, args: Args) -> Result<()> {
13 | |
14 | |
15 | | Ok(())
16 | | }
| |_^
|
= 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/mrpack.rs#L12
warning: unused `async` for function with no await statements
--> src/commands/export/mrpack.rs:12:1
|
12 | / pub async fn run(app: Arc<App>, args: Args) -> Result<()> {
13 | |
14 | |
15 | | Ok(())
16 | | }
| |_^
|
= 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/update.rs#L12
warning: unused `async` for function with no await statements
--> src/commands/update.rs:12:1
|
12 | / pub async fn run(app: Arc<App>, args: Args) -> Result<()> {
13 | | println!("{:#?}", git::version_check());
14 | |
15 | | Ok(())
16 | | }
| |_^
|
= 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/migrate.rs#L38
warning: unused `async` for function with no await statements
--> src/commands/migrate.rs:38:1
|
38 | / pub async fn migrate_server() -> Result<()> {
39 | | let legacy_server = read_toml::<LegacyServer>(&PathBuf::from("./server.toml"))
40 | | .with_context(|| "Reading server.toml")?;
... |
124 | | Ok(())
125 | | }
| |_^
|
= 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/markdown/print.rs#L10
warning: unused `async` for function with no await statements
--> src/commands/markdown/print.rs:10:1
|
10 | / pub async fn run(app: Arc<App>, args: Args) -> Result<()> {
11 | | todo!();
12 | |
13 | | Ok(())
14 | | }
| |_^
|
= 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/api/ws/mod.rs#L84
warning: unused `async` for function with no await statements
--> src/api/ws/mod.rs:84:5
|
84 | / pub async fn handle_event(self: Arc<Self>, event: MsgIn) -> Result<()> {
85 | |
86 | |
87 | | Ok(())
88 | | }
| |_____^
|
= 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/api/utils/zip.rs#L45
warning: unused `async` for function with no await statements
--> src/api/utils/zip.rs:45:1
|
45 | / pub async fn zip<T: Write + Seek>(writer: T, folder: &Path) -> Result<()> {
46 | | let mut archive = ZipWriter::new(writer);
47 | |
48 | | archive.set_comment(format!("generated by mcman/{APP_VERSION}"));
... |
67 | | Ok(())
68 | | }
| |_^
|
= 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/api/utils/zip.rs#L12
warning: unused `async` for function with no await statements
--> src/api/utils/zip.rs:12:1
|
12 | / pub async fn unzip<T: Read + Seek>(reader: T, to: &Path, prefix: Option<String>) -> Result<()> {
13 | | let mut archive = ZipArchive::new(reader)?;
14 | |
15 | | let mut files = archive.file_names().map(ToOwned::to_owned).collect::<Vec<_>>();
... |
41 | | Ok(())
42 | | }
| |_^
|
= 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/api/utils/accessor.rs#L43
warning: unused `async` for function with no await statements
--> src/api/utils/accessor.rs:43:5
|
43 | / pub async fn dir(&self) -> Result<Vec<String>> {
44 | | match self {
45 | | Accessor::ZipLocal((_, zip)) => Ok(zip.file_names().map(ToOwned::to_owned).collect()),
46 | | Accessor::Local(path) => Ok(path
... |
52 | | }
53 | | }
| |_____^
|
= 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/api/sources/quilt/mod.rs#L59
warning: unused `async` for function with no await statements
--> src/api/sources/quilt/mod.rs:59:5
|
59 | / pub async fn resolve_steps_build(
60 | | &self,
61 | | jar_name: &str,
62 | | mc_version: &str,
... |
92 | | ])
93 | | }
| |_____^
|
= 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/api/sources/buildtools/mod.rs#L54
warning: unused `async` for function with no await statements
--> src/api/sources/buildtools/mod.rs:54:1
|
54 | / pub async fn resolve_compile_steps(
55 | | _app: &App,
56 | | jar_name: &str,
57 | | craftbukkit: bool,
... |
92 | | ])
93 | | }
| |_^
|
= 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/api/sources/buildtools/mod.rs#L29
warning: unused `async` for function with no await statements
--> src/api/sources/buildtools/mod.rs:29:1
|
29 | / pub async fn resolve_remove_steps(
30 | | _app: &App,
31 | | _craftbukkit: bool,
32 | | _custom_args: &Vec<String>,
... |
35 | | Ok(vec![Step::RemoveFile(FileMeta::filename(String::from("server.jar")))])
36 | | }
| |_^
|
= 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/api/sources/spigot/mod.rs#L71
warning: unused `async` for function with no await statements
--> src/api/sources/spigot/mod.rs:71:5
|
71 | / pub async fn resolve_remove_steps(&self, id: &str, version: &str) -> Result<Vec<Step>> {
72 | | Ok(vec![
73 | | Step::RemoveFile(FileMeta::filename(format!("spigot-{}-{}.jar", resource_id(id), version)))
74 | | ])
75 | | }
| |_____^
|
= 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/api/sources/spigot/mod.rs#L51
warning: unused `async` for function with no await statements
--> src/api/sources/spigot/mod.rs:51:5
|
51 | / pub async fn resolve_steps(&self, id: &str, version: &str) -> Result<Vec<Step>> {
52 | | let url = format!(
53 | | "{}/resources/{}/versions/{}/download/proxy",
54 | | self.0.options.api_urls.spiget,
... |
68 | | ])
69 | | }
| |_____^
|
= 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/api/sources/fabric/mod.rs#L25
warning: unused `async` for function with no await statements
--> src/api/sources/fabric/mod.rs:25:5
|
25 | / pub async fn resolve_steps(
26 | | &self,
27 | | mc_version: &str,
28 | | loader: &str,
... |
64 | | Ok(steps)
65 | | }
| |_____^
|
= 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/api/sources/maven/mod.rs#L83
warning: unused `async` for function with no await statements
--> src/api/sources/maven/mod.rs:83:5
|
83 | / pub async fn resolve(
84 | | &self,
85 | | url: &str,
86 | | group_id: &str,
... |
116 | | Ok((download_url, metadata))
117 | | }
| |_____^
|
= 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/api/models/packwiz/mod.rs#L72
warning: unused `async` for function with no await statements
--> src/api/models/packwiz/mod.rs:72:5
|
72 | / pub async fn into_addon(&self, app: &App, target: AddonTarget) -> Result<Addon> {
73 | | let addon_type = if let Some(update) = &self.update {
74 | | match update {
75 | | PackwizModUpdate::Modrinth { mod_id, version } => AddonType::Modrinth {
... |
101 | | Ok(addon)
102 | | }
| |_____^
|
= 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/api/models/packwiz/mod.rs#L51
warning: unused `async` for function with no await statements
--> src/api/models/packwiz/mod.rs:51:5
|
51 | / pub async fn from_steps(steps: &Vec<Step>) -> Self {
52 | | todo!()
53 | | }
| |_____^
|
= 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/api/models/mrpack/mod.rs#L35
warning: unused `async` for function with no await statements
--> src/api/models/mrpack/mod.rs:35:5
|
35 | / pub async fn into_addon(&self) -> Result<Addon> {
36 | | Ok(Addon {
37 | | environment: self.env.as_ref().map(|e| e.clone().into()),
38 | | addon_type: AddonType::Url {
... |
46 | | })
47 | | }
| |_____^
|
= 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/api/app/actions/build/bootstrap.rs#L66
warning: unused `async` for function with no await statements
--> src/api/app/actions/build/bootstrap.rs:66:5
|
66 | / pub async fn should_bootstrap_file(&self, file: &Path) -> bool {
67 | | let ext = file.extension().unwrap_or_default().to_str().unwrap_or_default();
68 | |
69 | | let bootstrap_exts = [
... |
82 | | bootstrap_exts.contains(&ext)
83 | | }
| |_____^
|
= 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: `-W clippy::unused-async` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::unused_async)]`
|
called `map(<f>).unwrap_or_else(<g>)` on an `Option` value:
src/commands/init.rs#L71
warning: called `map(<f>).unwrap_or_else(<g>)` on an `Option` value
--> src/commands/init.rs:71:24
|
71 | let name: String = args.name.map(Ok).unwrap_or_else(|| cliclack::input("Name of the network?").interact())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `args.name.map_or_else(|| cliclack::input("Name of the network?").interact(), Ok)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or
|
called `map(<f>).unwrap_or_else(<g>)` on an `Option` value:
src/commands/init.rs#L46
warning: called `map(<f>).unwrap_or_else(<g>)` on an `Option` value
--> src/commands/init.rs:46:24
|
46 | let name: String = args.name.map(Ok).unwrap_or_else(|| cliclack::input("Name of the server?").interact())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `args.name.map_or_else(|| cliclack::input("Name of the server?").interact(), Ok)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or
|
item in documentation is missing backticks:
src/api/ws/mod.rs#L1
warning: item in documentation is missing backticks
--> src/api/ws/mod.rs:1:5
|
1 | //! WebSocket Server implementation for third party editors
| ^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
1 | //! `WebSocket` Server implementation for third party editors
| ~~~~~~~~~~~
|
this function's return value is unnecessary:
src/api/utils/logger/mod.rs#L3
warning: this function's return value is unnecessary
--> src/api/utils/logger/mod.rs:3:1
|
3 | / pub fn init_logger() -> Result<()> {
4 | | env_logger::init();
5 | |
6 | | Ok(())
7 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
= note: `-W clippy::unnecessary-wraps` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::unnecessary_wraps)]`
help: remove the return type...
|
3 | pub fn init_logger() -> Result<()> {
| ~~~~~~~~~~
help: ...and then remove returned values
|
6 - Ok(())
6 +
|
|
consider adding a `;` to the last statement for consistent formatting:
src/api/utils/zip.rs#L19
warning: consider adding a `;` to the last statement for consistent formatting
--> src/api/utils/zip.rs:19:13
|
19 | / files = files.into_iter()
20 | | .map(|f| f.replacen(&prefix, "", 1))
21 | | .collect()
| |__________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a `;` here
|
19 ~ files = files.into_iter()
20 + .map(|f| f.replacen(&prefix, "", 1))
21 + .collect();
|
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/utils/script.rs#L45
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/utils/script.rs:45:24
|
45 | pub fn script_args(&self) -> &'static str {
| ^^^^^ 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
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/utils/script.rs#L38
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/utils/script.rs:38:21
|
38 | pub fn line_sep(&self) -> &'static str {
| ^^^^^ 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
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/utils/script.rs#L31
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/utils/script.rs:31:21
|
31 | pub fn file_ext(&self) -> &'static str {
| ^^^^^ 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
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/utils/script.rs#L24
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/utils/script.rs:24:19
|
24 | pub fn header(&self) -> &'static str {
| ^^^^^ 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
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/utils/script.rs#L17
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/utils/script.rs:17:20
|
17 | pub fn comment(&self, comment: &str) -> 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
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/utils/script.rs#L8
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/utils/script.rs:8:28
|
8 | pub fn generate_script(&self, lines: Vec<String>) -> 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
|
this argument is passed by value, but not consumed in the function body:
src/api/utils/script.rs#L8
warning: this argument is passed by value, but not consumed in the function body
--> src/api/utils/script.rs:8:42
|
8 | pub fn generate_script(&self, lines: Vec<String>) -> String {
| ^^^^^^^^^^^ help: consider changing the type to: `&[String]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
|
called `.collect::<Vec<String>>().join("")` on an iterator:
src/api/utils/markdown/mod.rs#L96
warning: called `.collect::<Vec<String>>().join("")` on an iterator
--> src/api/utils/markdown/mod.rs:96:16
|
96 | li.collect::<Vec<_>>().join("")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `collect::<String>()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_join
= note: `-W clippy::unnecessary-join` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::unnecessary_join)]`
|
this argument is passed by value, but not consumed in the function body:
src/api/utils/markdown/mod.rs#L91
warning: this argument is passed by value, but not consumed in the function body
--> src/api/utils/markdown/mod.rs:91:45
|
91 | fn wrap(tag: &'static str, content: String) -> String {
| ^^^^^^ help: consider changing the type to: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/utils/serde.rs#L41
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/utils/serde.rs:41:19
|
41 | pub fn is_true(b: &bool) -> bool {
| ^^^^^ help: consider passing by value instead: `bool`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref
|
unnecessary `!=` operation:
src/api/utils/pathdiff.rs#L69
warning: unnecessary `!=` operation
--> src/api/utils/pathdiff.rs:69:5
|
69 | / if path.is_absolute() != base.is_absolute() {
70 | | if path.is_absolute() {
71 | | Some(PathBuf::from(path))
72 | | } else {
... |
102 | | Some(comps.iter().map(|c| c.as_os_str()).collect())
103 | | }
| |_____^
|
= help: change to `==` 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
|
usage of wildcard import:
src/api/utils/pathdiff.rs#L3
warning: usage of wildcard import
--> src/api/utils/pathdiff.rs:3:5
|
3 | use std::path::*;
| ^^^^^^^^^^^^ help: try: `std::path::{Component, Path, PathBuf}`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports
|
you should put bare URLs between `<`/`>` or make a proper Markdown link:
src/api/utils/pathdiff.rs#L1
warning: you should put bare URLs between `<`/`>` or make a proper Markdown link
--> src/api/utils/pathdiff.rs:1:5
|
1 | //! https://github.com/Manishearth/pathdiff
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `<https://github.com/Manishearth/pathdiff>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/utils/hashing/mod.rs#L25
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/utils/hashing/mod.rs:25:23
|
25 | pub fn get_digest(&self) -> Box<dyn DynDigest + Send> {
| ^^^^^ 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
|
consider adding a `;` to the last statement for consistent formatting:
src/api/utils/hashing/curseforge.rs#L24
warning: consider adding a `;` to the last statement for consistent formatting
--> src/api/utils/hashing/curseforge.rs:24:9
|
24 | self.0 = Vec::new()
| ^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `self.0 = Vec::new();`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
|
consider adding a `;` to the last statement for consistent formatting:
src/api/utils/hashing/curseforge.rs#L14
warning: consider adding a `;` to the last statement for consistent formatting
--> src/api/utils/hashing/curseforge.rs:14:9
|
14 | / self.0.extend(
15 | | data.iter()
16 | | .copied()
17 | | .filter(|&e| e != 9 && e != 10 && e != 13 && e != 32),
18 | | )
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a `;` here
|
14 ~ self.0.extend(
15 + data.iter()
16 + .copied()
17 + .filter(|&e| e != 9 && e != 10 && e != 13 && e != 32),
18 + );
|
|
redundant closure:
src/api/utils/accessor.rs#L48
warning: redundant closure
--> src/api/utils/accessor.rs:48:29
|
48 | .filter_map(|r| r.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
|
case-sensitive file extension comparison:
src/api/utils/accessor.rs#L32
warning: case-sensitive file extension comparison
--> src/api/utils/accessor.rs:32:19
|
32 | } else if str.ends_with(".zip") || str.ends_with(".mrpack") {
| ^^^^^^^^^^^^^^^^^^^^^
|
= 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: `-W clippy::case-sensitive-file-extension-comparisons` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::case_sensitive_file_extension_comparisons)]`
help: use std::path::Path
|
32 ~ } else if std::path::Path::new(str)
33 + .extension()
34 ~ .map_or(false, |ext| ext.eq_ignore_ascii_case("zip")) || str.ends_with(".mrpack") {
|
|
this match arm has an identical body to another arm:
src/api/utils/accessor.rs#L23
warning: this match arm has an identical body to another arm
--> src/api/utils/accessor.rs:23:13
|
23 | Accessor::ZipLocal((path ,_)) => path.to_string_lossy().into_owned(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try changing either arm body
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
help: or try merging the arm patterns
|
23 | Accessor::ZipLocal((path ,_)) | Accessor::Local(path) => path.to_string_lossy().into_owned(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: and remove this obsolete arm
|
21 - Accessor::Local(path) => path.to_string_lossy().into_owned(),
|
|
unnecessary `!=` operation:
src/api/tools/java/check.rs#L10
warning: unnecessary `!=` operation
--> src/api/tools/java/check.rs:10:16
|
10 | let path = if path.file_name()?.to_str()? != JAVA_BIN {
| ________________^
11 | | path.join(JAVA_BIN)
12 | | } else {
13 | | path.clone()
14 | | };
| |_____^
|
= help: change to `==` 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: `-W clippy::if-not-else` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::if_not_else)]`
|
this match arm has an identical body to another arm:
src/api/tools/java/installation.rs#L23
warning: this match arm has an identical body to another arm
--> src/api/tools/java/installation.rs:23:13
|
23 | (Some("1"), Some(ver)) => ver,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try changing either arm body
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
help: or try merging the arm patterns
|
23 | (Some("1"), Some(ver)) | (Some(ver), _) => ver,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: and remove this obsolete arm
|
24 - (Some(ver), _) => ver,
|
|
wildcard matches only a single variant and will also match any future added variants:
src/api/sources/quilt/mod.rs#L83
warning: wildcard matches only a single variant and will also match any future added variants
--> src/api/sources/quilt/mod.rs:83:13
|
83 | _ => {},
| ^ help: try: `Environment::Both`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants
|
item in documentation is missing backticks:
src/api/sources/buildtools/mod.rs#L53
warning: item in documentation is missing backticks
--> src/api/sources/buildtools/mod.rs:53:29
|
53 | /// Resolve steps for using BuildTools to compile a server jar
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
53 | /// Resolve steps for using `BuildTools` to compile a server jar
| ~~~~~~~~~~~~
|
wildcard matches only a single variant and will also match any future added variants:
src/api/sources/vanilla/mod.rs#L57
warning: wildcard matches only a single variant and will also match any future added variants
--> src/api/sources/vanilla/mod.rs:57:13
|
57 | _ => bail!("You cant have both smh"),
| ^ help: try: `Environment::Both`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants
= note: `-W clippy::match-wildcard-for-single-variants` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::match_wildcard_for_single_variants)]`
|
item in documentation is missing backticks:
src/api/sources/vanilla/version.rs#L179
warning: item in documentation is missing backticks
--> src/api/sources/vanilla/version.rs:179:10
|
179 | /// (AssetIndex only) The size of the game version's assets
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
179 | /// (`AssetIndex` only) The size of the game version's assets
| ~~~~~~~~~~~~
|
item in documentation is missing backticks:
src/api/sources/vanilla/version.rs#L177
warning: item in documentation is missing backticks
--> src/api/sources/vanilla/version.rs:177:10
|
177 | /// (AssetIndex only) The game version ID the assets are for
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
177 | /// (`AssetIndex` only) The game version ID the assets are for
| ~~~~~~~~~~~~
|
item in documentation is missing backticks:
src/api/sources/vanilla/version.rs#L149
warning: item in documentation is missing backticks
--> src/api/sources/vanilla/version.rs:149:13
|
149 | /// The HashMap key specifies a classifier as additional information for downloading files
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
149 | /// The `HashMap` key specifies a classifier as additional information for downloading files
| ~~~~~~~~~
|
possible intra-doc link using quotes instead of backticks:
src/api/sources/vanilla/version.rs#L87
warning: possible intra-doc link using quotes instead of backticks
--> src/api/sources/vanilla/version.rs:87:25
|
87 | /// "exclude": ["META-INF/"],
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_link_with_quotes
= note: `-W clippy::doc-link-with-quotes` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_link_with_quotes)]`
|
all fields have the same postfix: `url`:
src/api/sources/curseforge/models.rs#L27
warning: all fields have the same postfix: `url`
--> src/api/sources/curseforge/models.rs:27:1
|
27 | / pub struct CurseforgeModLinks {
28 | | pub website_url: String,
29 | | pub wiki_url: String,
30 | | pub issues_url: String,
31 | | pub source_url: String,
32 | | }
| |_^
|
= help: remove the postfixes
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#struct_field_names
|
usage of wildcard import:
src/api/models/legacy/server_launcher.rs#L5
warning: usage of wildcard import
--> src/api/models/legacy/server_launcher.rs:5:5
|
5 | use crate::api::utils::serde::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::api::utils::serde::is_default`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports
|
usage of wildcard import:
src/api/models/legacy/server_type.rs#L2
warning: usage of wildcard import
--> src/api/models/legacy/server_type.rs:2:5
|
2 | use crate::api::utils::serde::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::api::utils::serde::str_latest`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports
|
usage of wildcard import:
src/api/models/launcher/mod.rs#L5
warning: usage of wildcard import
--> src/api/models/launcher/mod.rs:5:5
|
5 | use crate::api::utils::serde::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::api::utils::serde::is_default`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/models/metadata/addon_metadata.rs#L62
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/models/metadata/addon_metadata.rs:62:21
|
62 | pub fn icon_url(&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
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/models/metadata/addon_metadata.rs#L58
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/models/metadata/addon_metadata.rs:58:17
|
58 | pub fn html(&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
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/models/metadata/addon_metadata.rs#L54
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/models/metadata/addon_metadata.rs:54:25
|
54 | pub fn markdown_tag(&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
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/models/metadata/addon_metadata.rs#L41
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/models/metadata/addon_metadata.rs:41:21
|
41 | pub fn into_str(&self) -> &'static str {
| ^^^^^ 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
|
this argument is passed by value, but not consumed in the function body:
src/api/models/markdown/render.rs#L10
warning: this argument is passed by value, but not consumed in the function body
--> src/api/models/markdown/render.rs:10:38
|
10 | pub fn table_addons(&self, list: Vec<AddonMetadata>, output: MarkdownOutput) -> MarkdownTable {
| ^^^^^^^^^^^^^^^^^^ help: consider changing the type to: `&[AddonMetadata]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
= note: `-W clippy::needless-pass-by-value` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::needless_pass_by_value)]`
|
usage of wildcard import:
src/api/models/markdown/mod.rs#L6
warning: usage of wildcard import
--> src/api/models/markdown/mod.rs:6:5
|
6 | use crate::api::utils::serde::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::api::utils::serde::{bool_true, is_default, is_true}`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports
|
redundant closure:
src/api/models/server/mod.rs#L91
warning: redundant closure
--> src/api/models/server/mod.rs:91:31
|
91 | self.jar.as_ref().map(|s| s.get_execution_arguments()).unwrap_or_default()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `server_type::ServerJar::get_execution_arguments`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
= note: `-W clippy::redundant-closure-for-method-calls` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::redundant_closure_for_method_calls)]`
|
called `map(<f>).unwrap_or(<a>)` on an `Option` value:
src/api/models/server/mod.rs#L84
warning: called `map(<f>).unwrap_or(<a>)` on an `Option` value
--> src/api/models/server/mod.rs:84:13
|
84 | get_java_installation_for(v).await.map(|j| j.path.to_string_lossy().into_owned()).unwrap_or(String::from("java"))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or
help: use `map_or(<a>, <f>)` instead
|
84 - get_java_installation_for(v).await.map(|j| j.path.to_string_lossy().into_owned()).unwrap_or(String::from("java"))
84 + get_java_installation_for(v).await.map_or(String::from("java"), |j| j.path.to_string_lossy().into_owned())
|
|
item in documentation is missing backticks:
src/api/models/server/mod.rs#L63
warning: item in documentation is missing backticks
--> src/api/models/server/mod.rs:63:18
|
63 | /// Gets the ServerJar via `jar` OR `Source` where `type=modpack`
| ^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
63 | /// Gets the `ServerJar` via `jar` OR `Source` where `type=modpack`
| ~~~~~~~~~~~
|
this match arm has an identical body to another arm:
src/api/models/server/server_type.rs#L217
warning: this match arm has an identical body to another arm
--> src/api/models/server/server_type.rs:217:13
|
217 | ServerType::BuildTools { .. } => Ok(false),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try changing either arm body
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
help: or try merging the arm patterns
|
217 | ServerType::BuildTools { .. } | ServerType::Vanilla { } => Ok(false),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: and remove this obsolete arm
|
191 - ServerType::Vanilla { } => Ok(false),
|
|
consider adding a `;` to the last statement for consistent formatting:
src/api/models/server/server_type.rs#L68
warning: consider adding a `;` to the last statement for consistent formatting
--> src/api/models/server/server_type.rs:68:13
|
68 | server_type = Some(ServerType::NeoForge { loader: v })
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `server_type = Some(ServerType::NeoForge { loader: v });`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
|
consider adding a `;` to the last statement for consistent formatting:
src/api/models/server/server_type.rs#L64
warning: consider adding a `;` to the last statement for consistent formatting
--> src/api/models/server/server_type.rs:64:13
|
64 | server_type = Some(ServerType::Forge { loader: v })
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `server_type = Some(ServerType::Forge { loader: v });`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
|
consider adding a `;` to the last statement for consistent formatting:
src/api/models/server/server_type.rs#L60
warning: consider adding a `;` to the last statement for consistent formatting
--> src/api/models/server/server_type.rs:60:13
|
60 | server_type = Some(ServerType::Quilt { loader: v, installer: String::from("latest") })
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `server_type = Some(ServerType::Quilt { loader: v, installer: String::from("latest") });`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
|
consider adding a `;` to the last statement for consistent formatting:
src/api/models/server/server_type.rs#L56
warning: consider adding a `;` to the last statement for consistent formatting
--> src/api/models/server/server_type.rs:56:13
|
56 | server_type = Some(ServerType::Quilt { loader: v, installer: String::from("latest") })
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `server_type = Some(ServerType::Quilt { loader: v, installer: String::from("latest") });`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
|
consider adding a `;` to the last statement for consistent formatting:
src/api/models/server/server_type.rs#L52
warning: consider adding a `;` to the last statement for consistent formatting
--> src/api/models/server/server_type.rs:52:13
|
52 | server_type = Some(ServerType::Fabric { loader: v, installer: String::from("latest") })
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `server_type = Some(ServerType::Fabric { loader: v, installer: String::from("latest") });`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
|
consider adding a `;` to the last statement for consistent formatting:
src/api/models/server/server_type.rs#L48
warning: consider adding a `;` to the last statement for consistent formatting
--> src/api/models/server/server_type.rs:48:13
|
48 | server_type = Some(ServerType::Fabric { loader: v, installer: String::from("latest") })
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `server_type = Some(ServerType::Fabric { loader: v, installer: String::from("latest") });`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
= note: `-W clippy::semicolon-if-nothing-returned` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::semicolon_if_nothing_returned)]`
|
usage of wildcard import:
src/api/models/server/server_type.rs#L4
warning: usage of wildcard import
--> src/api/models/server/server_type.rs:4:102
|
4 | app::App, models::{Addon, AddonTarget, AddonType, Environment}, sources::buildtools, step::Step, utils::serde::*
| ^^^^^^^^^^^^^^^ help: try: `utils::serde::str_latest`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports
= note: `-W clippy::wildcard-imports` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::wildcard_imports)]`
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/models/server/server_flavor.rs#L45
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/models/server/server_flavor.rs:45:31
|
45 | pub fn supports_eula_args(&self) -> bool {
| ^^^^^ 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
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/models/server/server_flavor.rs#L38
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/models/server/server_flavor.rs:38:27
|
38 | pub fn supports_nogui(&self) -> bool {
| ^^^^^ 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
|
this match arm has an identical body to another arm:
src/api/models/server/server_flavor.rs#L33
warning: this match arm has an identical body to another arm
--> src/api/models/server/server_flavor.rs:33:13
|
33 | ServerFlavor::Patched => true,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try changing either arm body
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
help: or try merging the arm patterns
|
33 | ServerFlavor::Patched | ServerFlavor::Proxy => true,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: and remove this obsolete arm
|
34 - ServerFlavor::Proxy => true,
35 - }
34 + }
|
|
this match arm has an identical body to another arm:
src/api/models/server/server_flavor.rs#L32
warning: this match arm has an identical body to another arm
--> src/api/models/server/server_flavor.rs:32:13
|
32 | ServerFlavor::Modded => false,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try changing either arm body
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
= note: `-W clippy::match-same-arms` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::match_same_arms)]`
help: or try merging the arm patterns
|
32 | ServerFlavor::Modded | ServerFlavor::Vanilla => false,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: and remove this obsolete arm
|
31 - ServerFlavor::Vanilla => false,
|
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/models/server/server_flavor.rs#L29
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/models/server/server_flavor.rs:29:29
|
29 | pub fn supports_plugins(&self) -> bool {
| ^^^^^ 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
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/models/server/server_flavor.rs#L22
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/models/server/server_flavor.rs:22:26
|
22 | pub fn supports_mods(&self) -> bool {
| ^^^^^ 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
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/models/server/server_flavor.rs#L15
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/models/server/server_flavor.rs:15:31
|
15 | pub fn supports_datapacks(&self) -> bool {
| ^^^^^ 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
|
called `map(<f>).unwrap_or(<a>)` on an `Option` value:
src/api/models/addon/addon_target.rs#L38
warning: called `map(<f>).unwrap_or(<a>)` on an `Option` value
--> src/api/models/addon/addon_target.rs:38:14
|
38 | &Path::new(path)
| ______________^
39 | | .parent()
40 | | .map(|p| p.to_string_lossy().into_owned())
41 | | .unwrap_or(".".to_owned()),
| |__________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or
help: use `map_or(<a>, <f>)` instead
|
40 - .map(|p| p.to_string_lossy().into_owned())
40 + .map_or(".".to_owned(), |p| p.to_string_lossy().into_owned()),
|
|
field name starts with the struct's name:
src/api/models/addon/addon.rs#L13
warning: field name starts with the struct's name
--> src/api/models/addon/addon.rs:13:5
|
13 | pub addon_type: AddonType,
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#struct_field_names
= note: `-W clippy::struct-field-names` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::struct_field_names)]`
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/models/env.rs#L31
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/models/env.rs:31:19
|
31 | pub fn client(&self) -> bool {
| ^^^^^ 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
|
this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
src/api/models/env.rs#L27
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> src/api/models/env.rs:27:19
|
27 | pub fn server(&self) -> bool {
| ^^^^^ 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: `-W clippy::trivially-copy-pass-by-ref` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::trivially_copy_pass_by_ref)]`
|
item in documentation is missing backticks:
src/api/app/step/mod.rs#L16
warning: item in documentation is missing backticks
--> src/api/app/step/mod.rs:16:49
|
16 | /// Skips the next step when a step returns StepResult::Skip
| ^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
16 | /// Skips the next step when a step returns `StepResult::Skip`
| ~~~~~~~~~~~~~~~~~~
|
item in documentation is missing backticks:
src/api/app/step/mod.rs#L15
warning: item in documentation is missing backticks
--> src/api/app/step/mod.rs:15:55
|
15 | /// Execute a list of steps, taking care of their StepResult's.
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
15 | /// Execute a list of steps, taking care of their `StepResult`'s.
| ~~~~~~~~~~~~
|
called `map(<f>).unwrap_or(<a>)` on an `Option` value:
src/api/app/step/execute_java.rs#L34
warning: called `map(<f>).unwrap_or(<a>)` on an `Option` value
--> src/api/app/step/execute_java.rs:34:55
|
34 | bail!("Java process exited with code {}", res.code().map(|x| x.to_string()).unwrap_or("unknown".to_owned()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or
help: use `map_or(<a>, <f>)` instead
|
34 - bail!("Java process exited with code {}", res.code().map(|x| x.to_string()).unwrap_or("unknown".to_owned()));
34 + bail!("Java process exited with code {}", res.code().map_or("unknown".to_owned(), |x| x.to_string()));
|
|
called `map(<f>).unwrap_or(<a>)` on an `Option` value:
src/api/app/step/execute_java.rs#L21
warning: called `map(<f>).unwrap_or(<a>)` on an `Option` value
--> src/api/app/step/execute_java.rs:21:88
|
21 | ...or higher not found, cannot proceed", version.map(|v| v.to_string()).unwrap_or("any".to_owned())))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or
= note: `-W clippy::map-unwrap-or` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::map_unwrap_or)]`
help: use `map_or(<a>, <f>)` instead
|
21 - .ok_or(anyhow!("Java with version {} or higher not found, cannot proceed", version.map(|v| v.to_string()).unwrap_or("any".to_owned())))?;
21 + .ok_or(anyhow!("Java with version {} or higher not found, cannot proceed", version.map_or("any".to_owned(), |v| v.to_string())))?;
|
|
adding items after statements is confusing, since items exist from the start of the scope:
src/api/app/step/execute_java.rs#L25
warning: adding items after statements is confusing, since items exist from the start of the scope
--> src/api/app/step/execute_java.rs:25:9
|
25 | / fn on_line(line: &str) {
26 | | println!("| {line}");
27 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
|
item in documentation is missing backticks:
src/api/app/actions/lockfile/mod.rs#L36
warning: item in documentation is missing backticks
--> src/api/app/actions/lockfile/mod.rs:36:30
|
36 | /// Adds an addon to the new_lockfile
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
= note: `-W clippy::doc-markdown` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_markdown)]`
help: try
|
36 | /// Adds an addon to the `new_lockfile`
| ~~~~~~~~~~~~~~
|
adding items after statements is confusing, since items exist from the start of the scope:
src/api/app/actions/build/bootstrap.rs#L39
warning: adding items after statements is confusing, since items exist from the start of the scope
--> src/api/app/actions/build/bootstrap.rs:39:9
|
39 | const MAX_CONCURRENT_TASKS: usize = 20;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
= note: `-W clippy::items-after-statements` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::items_after_statements)]`
|
function `action_init_network` is never used:
src/commands/init.rs#L65
warning: function `action_init_network` is never used
--> src/commands/init.rs:65:14
|
65 | pub async fn action_init_network(app: Arc<App>, args: Args) -> Result<()> {
| ^^^^^^^^^^^^^^^^^^^
|
method `broadcast` is never used:
src/api/ws/mod.rs#L64
warning: method `broadcast` is never used
--> src/api/ws/mod.rs:64:18
|
23 | impl WebsocketServer {
| -------------------- method in this implementation
...
64 | pub async fn broadcast(self: Arc<Self>, event: MsgOut) -> Result<()> {
| ^^^^^^^^^
|
field `app` is never read:
src/api/ws/mod.rs#L19
warning: field `app` is never read
--> src/api/ws/mod.rs:19:5
|
18 | pub struct WebsocketServer {
| --------------- field in this struct
19 | app: Arc<App>,
| ^^^
|
type alias `WebsocketStream` is never used:
src/api/ws/mod.rs#L16
warning: type alias `WebsocketStream` is never used
--> src/api/ws/mod.rs:16:10
|
16 | pub type WebsocketStream = SplitStream<WebSocketStream<TcpStream>>;
| ^^^^^^^^^^^^^^^
|
associated function `from` is never used:
src/api/utils/update_writer.rs#L19
warning: associated function `from` is never used
--> src/api/utils/update_writer.rs:19:12
|
18 | impl UpdateWriter {
| ----------------- associated function in this implementation
19 | pub fn from(source: &Source, relative_to: &Path) -> Result<Self> {
| ^^^^
|
enum `UpdateWriter` is never used:
src/api/utils/update_writer.rs#L12
warning: enum `UpdateWriter` is never used
--> src/api/utils/update_writer.rs:12:10
|
12 | pub enum UpdateWriter {
| ^^^^^^^^^^^^
|
function `some_if_exists` is never used:
src/api/utils/fs.rs#L18
warning: function `some_if_exists` is never used
--> src/api/utils/fs.rs:18:8
|
18 | pub fn some_if_exists<T: ?Sized + AsRef<OsStr>>(path: &T) -> Option<PathBuf> {
| ^^^^^^^^^^^^^^
|
function `zip` is never used:
src/api/utils/zip.rs#L45
warning: function `zip` is never used
--> src/api/utils/zip.rs:45:14
|
45 | pub async fn zip<T: Write + Seek>(writer: T, folder: &Path) -> Result<()> {
| ^^^
|
function `unzip` is never used:
src/api/utils/zip.rs#L12
warning: function `unzip` is never used
--> src/api/utils/zip.rs:12:14
|
12 | pub async fn unzip<T: Read + Seek>(reader: T, to: &Path, prefix: Option<String>) -> Result<()> {
| ^^^^^
|
field `1` is never read:
src/api/utils/markdown/mod.rs#L62
warning: field `1` is never read
--> src/api/utils/markdown/mod.rs:62:39
|
62 | pub struct MarkdownHeader(pub String, pub HeaderAlignment);
| -------------- ^^^^^^^^^^^^^^^^^^^
| |
| field in this struct
|
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
62 | pub struct MarkdownHeader(pub String, ());
| ~~
|
variants `Left` and `Right` are never constructed:
src/api/utils/markdown/mod.rs#L56
warning: variants `Left` and `Right` are never constructed
--> src/api/utils/markdown/mod.rs:56:5
|
55 | pub enum HeaderAlignment {
| --------------- variants in this enum
56 | Left,
| ^^^^
...
59 | Right,
| ^^^^^
|
= note: `HeaderAlignment` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
|
associated items `new` and `generate` are never used:
src/api/utils/markdown/mod.rs#L17
warning: associated items `new` and `generate` are never used
--> src/api/utils/markdown/mod.rs:17:12
|
13 | / impl<T> MarkdownTableGenerator<T>
14 | | where
15 | | T: Serialize + std::fmt::Debug
| |__________________________________- associated items in this implementation
16 | {
17 | pub fn new(items: Vec<T>) -> Self {
| ^^^
...
21 | pub fn generate(self) -> Result<MarkdownTable> {
| ^^^^^^^^
|
struct `MarkdownTableGenerator` is never constructed:
src/api/utils/markdown/mod.rs#L7
warning: struct `MarkdownTableGenerator` is never constructed
--> src/api/utils/markdown/mod.rs:7:12
|
7 | pub struct MarkdownTableGenerator<T>
| ^^^^^^^^^^^^^^^^^^^^^^
|
method `diff_to` is never used:
src/api/utils/pathdiff.rs#L8
warning: method `diff_to` is never used
--> src/api/utils/pathdiff.rs:8:8
|
7 | pub trait DiffTo {
| ------ method in this trait
8 | fn diff_to<P>(&self, path: P) -> Option<PathBuf>
| ^^^^^^^
|
function `is_dirty` is never used:
src/api/tools/git/mod.rs#L26
warning: function `is_dirty` is never used
--> src/api/tools/git/mod.rs:26:8
|
26 | pub fn is_dirty() -> Result<bool> {
| ^^^^^^^^
|
function `require_git` is never used:
src/api/tools/git/mod.rs#L9
warning: function `require_git` is never used
--> src/api/tools/git/mod.rs:9:8
|
9 | pub fn require_git() -> Result<()> {
| ^^^^^^^^^^^
|
static `GIT_VERSION` is never used:
src/api/tools/git/mod.rs#L7
warning: static `GIT_VERSION` is never used
--> src/api/tools/git/mod.rs:7:8
|
7 | static GIT_VERSION: LazyLock<Option<String>> = LazyLock::new(|| version_check());
| ^^^^^^^^^^^
|
methods `get` and `ls` are never used:
src/api/sources/mcman_meta/mod.rs#L9
warning: methods `get` and `ls` are never used
--> src/api/sources/mcman_meta/mod.rs:9:18
|
8 | impl<'a> McmanMetaAPI<'a> {
| ------------------------- methods in this implementation
9 | pub async fn get(&self, folder: &str, path: &str) -> Result<String> {
| ^^^
...
16 | pub async fn ls(&self, folder: &str) -> Result<Vec<String>> {
| ^^
|
struct `McmanMetaAPI` is never constructed:
src/api/sources/mcman_meta/mod.rs#L6
warning: struct `McmanMetaAPI` is never constructed
--> src/api/sources/mcman_meta/mod.rs:6:12
|
6 | pub struct McmanMetaAPI<'a>(pub &'a App);
| ^^^^^^^^^^^^
|
function `resolve_remove_steps` is never used:
src/api/sources/buildtools/mod.rs#L29
warning: function `resolve_remove_steps` is never used
--> src/api/sources/buildtools/mod.rs:29:14
|
29 | pub async fn resolve_remove_steps(
| ^^^^^^^^^^^^^^^^^^^^
|
methods `fetch_versions` and `fetch_version` are never used:
src/api/sources/spigot/mod.rs#L35
warning: methods `fetch_versions` and `fetch_version` are never used
--> src/api/sources/spigot/mod.rs:35:18
|
21 | impl<'a> SpigotAPI<'a> {
| ---------------------- methods in this implementation
...
35 | pub async fn fetch_versions(&self, id: &str) -> Result<Vec<SpigotVersionDetailed>> {
| ^^^^^^^^^^^^^^
...
43 | pub async fn fetch_version(&self, id: &str, version: &str) -> Result<SpigotVersionDetailed> {
| ^^^^^^^^^^^^^
|
methods `fetch_project_versions` and `get_download_url` are never used:
src/api/sources/hangar/mod.rs#L22
warning: methods `fetch_project_versions` and `get_download_url` are never used
--> src/api/sources/hangar/mod.rs:22:18
|
13 | impl<'a> HangarAPI<'a> {
| ---------------------- methods in this implementation
...
22 | pub async fn fetch_project_versions(&self, id: &str) -> Result<ProjectVersionsResponse> {
| ^^^^^^^^^^^^^^^^^^^^^^
...
30 | pub fn get_download_url(&self, id: &str, version: &str, platform: &str) -> String {
| ^^^^^^^^^^^^^^^^
|
methods `fetch_loaders`, `fetch_versions`, and `fetch_installers` are never used:
src/api/sources/fabric/mod.rs#L13
warning: methods `fetch_loaders`, `fetch_versions`, and `fetch_installers` are never used
--> src/api/sources/fabric/mod.rs:13:18
|
12 | impl<'a> FabricAPI<'a> {
| ---------------------- methods in this implementation
13 | pub async fn fetch_loaders(&self) -> Result<Vec<FabricLoader>> {
| ^^^^^^^^^^^^^
...
17 | pub async fn fetch_versions(&self) -> Result<Vec<FabricVersion>> {
| ^^^^^^^^^^^^^^
...
21 | pub async fn fetch_installers(&self) -> Result<Vec<FabricInstaller>> {
| ^^^^^^^^^^^^^^^^
|
field `0` is never read:
src/api/sources/fabric/mod.rs#L10
warning: field `0` is never read
--> src/api/sources/fabric/mod.rs:10:26
|
10 | pub struct FabricAPI<'a>(pub &'a App);
| --------- ^^^^^^^^^^^
| |
| field in this struct
|
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
10 | pub struct FabricAPI<'a>(());
| ~~
|
method `find_url` is never used:
src/api/sources/maven/models.rs#L43
warning: method `find_url` is never used
--> src/api/sources/maven/models.rs:43:12
|
42 | impl MavenMetadata {
| ------------------ method in this implementation
43 | pub fn find_url(&self, url: &str) -> Option<(String, String)> {
| ^^^^^^^^
|
methods `get_text` and `get_text_all` are never used:
src/api/sources/maven/models.rs#L4
warning: methods `get_text` and `get_text_all` are never used
--> src/api/sources/maven/models.rs:4:8
|
3 | pub trait XMLExt {
| ------ methods in this trait
4 | fn get_text(&self, k: &str) -> Result<String>;
| ^^^^^^^^
5 | fn get_text_all(&self, k: &str) -> Vec<String>;
| ^^^^^^^^^^^^
|
methods `find_maven_artifact`, `fetch_metadata`, and `fetch_metadata_url` are never used:
src/api/sources/maven/mod.rs#L50
warning: methods `find_maven_artifact`, `fetch_metadata`, and `fetch_metadata_url` are never used
--> src/api/sources/maven/mod.rs:50:18
|
49 | impl<'a> MavenAPI<'a> {
| --------------------- methods in this implementation
50 | pub async fn find_maven_artifact(&self, url: &str) -> Result<MavenMetadata> {
| ^^^^^^^^^^^^^^^^^^^
...
60 | pub async fn fetch_metadata(
| ^^^^^^^^^^^^^^
...
70 | pub async fn fetch_metadata_url(&self, url: &str) -> Result<MavenMetadata> {
| ^^^^^^^^^^^^^^^^^^
|
function `guess_maven_metadata_url` is never used:
src/api/sources/maven/mod.rs#L25
warning: function `guess_maven_metadata_url` is never used
--> src/api/sources/maven/mod.rs:25:8
|
25 | pub fn guess_maven_metadata_url(url: &str) -> Result<String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
function `maven_metadata_url` is never used:
src/api/sources/maven/mod.rs#L17
warning: function `maven_metadata_url` is never used
--> src/api/sources/maven/mod.rs:17:8
|
17 | pub fn maven_metadata_url(url: &str, group_id: &str, artifact_id: &str) -> String {
| ^^^^^^^^^^^^^^^^^^
|
field `0` is never read:
src/api/sources/maven/mod.rs#L8
warning: field `0` is never read
--> src/api/sources/maven/mod.rs:8:25
|
8 | pub struct MavenAPI<'a>(pub &'a App);
| -------- ^^^^^^^^^^^
| |
| field in this struct
|
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
8 | pub struct MavenAPI<'a>(());
| ~~
|
method `fetch_versions` is never used:
src/api/sources/papermc/mod.rs#L21
warning: method `fetch_versions` is never used
--> src/api/sources/papermc/mod.rs:21:18
|
13 | impl<'a> PaperMCAPI<'a> {
| ----------------------- method in this implementation
...
21 | pub async fn fetch_versions(&self, project: &str) -> Result<Vec<String>> {
| ^^^^^^^^^^^^^^
|
method `paste_log` is never used:
src/api/sources/mclogs/mod.rs#L16
warning: method `paste_log` is never used
--> src/api/sources/mclogs/mod.rs:16:18
|
15 | impl<'a> MCLogsAPI<'a> {
| ---------------------- method in this implementation
16 | pub async fn paste_log(&self, content: &str) -> Result<LogFileMetadata> {
| ^^^^^^^^^
|
function `dollar_repl` is never used:
src/api/sources/vanilla/rulematcher.rs#L187
warning: function `dollar_repl` is never used
--> src/api/sources/vanilla/rulematcher.rs:187:4
|
187 | fn dollar_repl<F>(input: &str, replacer: F) -> String
| ^^^^^^^^^^^
|
multiple associated items are never used:
src/api/sources/vanilla/rulematcher.rs#L20
warning: multiple associated items are never used
--> src/api/sources/vanilla/rulematcher.rs:20:12
|
17 | impl PistonRuleMatcher {
| ---------------------- associated items in this implementation
...
20 | pub fn new(os_name: String, os_arch: String, os_version: String) -> Self {
| ^^^
...
33 | pub fn empty() -> Self {
| ^^^^^
...
47 | pub fn from_os() -> Self {
| ^^^^^^^
...
71 | pub fn should_download_library(&self, library: &PistonLibrary) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^
...
79 | pub fn get_native_library(&self, library: &PistonLibrary) -> Option<PistonFile> {
| ^^^^^^^^^^^^^^^^^^
...
93 | pub fn match_rules(&self, rules: &Vec<PistonRule>) -> bool {
| ^^^^^^^^^^^
...
107 | pub fn match_rule(&self, rule: &PistonRule) -> bool {
| ^^^^^^^^^^
...
117 | pub fn match_constraint(&self, constraint: &PistonRuleConstraints) -> bool {
| ^^^^^^^^^^^^^^^^
...
145 | pub fn build_args(
| ^^^^^^^^^^
...
172 | pub fn process_string(&self, map: &HashMap<String, String>, input: &str) -> String {
| ^^^^^^^^^^^^^^
|
struct `PistonRuleMatcher` is never constructed:
src/api/sources/vanilla/rulematcher.rs#L12
warning: struct `PistonRuleMatcher` is never constructed
--> src/api/sources/vanilla/rulematcher.rs:12:12
|
12 | pub struct PistonRuleMatcher {
| ^^^^^^^^^^^^^^^^^
|
method `find` is never used:
src/api/sources/vanilla/manifest.rs#L16
warning: method `find` is never used
--> src/api/sources/vanilla/manifest.rs:16:12
|
13 | impl VersionManifest {
| -------------------- method in this implementation
...
16 | pub fn find(&self, id: &str) -> Option<VersionIndex> {
| ^^^^
|
methods `get_url` and `get_path` are never used:
src/api/sources/vanilla/assets.rs#L21
warning: methods `get_url` and `get_path` are never used
--> src/api/sources/vanilla/assets.rs:21:12
|
18 | impl MCAsset {
| ------------ methods in this implementation
...
21 | pub fn get_url(&self) -> String {
| ^^^^^^^
...
27 | pub fn get_path(&self) -> String {
| ^^^^^^^^
|
constant `RESOURCES_URL` is never used:
src/api/sources/vanilla/assets.rs#L4
warning: constant `RESOURCES_URL` is never used
--> src/api/sources/vanilla/assets.rs:4:11
|
4 | pub const RESOURCES_URL: &str = "https://resources.download.minecraft.net";
| ^^^^^^^^^^^^^
|
method `fetch_latest_mcver` is never used:
src/api/sources/vanilla/mod.rs#L49
warning: method `fetch_latest_mcver` is never used
--> src/api/sources/vanilla/mod.rs:49:18
|
44 | impl<'a> VanillaAPI<'a> {
| ----------------------- method in this implementation
...
49 | pub async fn fetch_latest_mcver(&self) -> Result<String> {
| ^^^^^^^^^^^^^^^^^^
|
methods `fetch_versions` and `version_from_hash` are never used:
src/api/sources/modrinth/mod.rs#L42
warning: methods `fetch_versions` and `version_from_hash` are never used
--> src/api/sources/modrinth/mod.rs:42:18
|
18 | impl<'a> ModrinthAPI<'a> {
| ------------------------ methods in this implementation
...
42 | pub async fn fetch_versions(&self, id: &str) -> Result<Vec<ModrinthVersion>> {
| ^^^^^^^^^^^^^^
...
114 | pub async fn version_from_hash(&self, hash: &str, algo: &str) -> Result<ModrinthVersion> {
| ^^^^^^^^^^^^^^^^^
|
method `fetch_download_url` is never used:
src/api/sources/curseforge/mod.rs#L38
warning: method `fetch_download_url` is never used
--> src/api/sources/curseforge/mod.rs:38:18
|
13 | impl<'a> CurseforgeAPI<'a> {
| -------------------------- method in this implementation
...
38 | pub async fn fetch_download_url(&self, mod_id: &str, file_id: &str) -> Result<String> {
| ^^^^^^^^^^^^^^^^^^
|
method `get_args` is never used:
src/api/models/launcher/mod.rs#L39
warning: method `get_args` is never used
--> src/api/models/launcher/mod.rs:39:12
|
38 | impl ServerLauncher {
| ------------------- method in this implementation
39 | pub fn get_args(&self, exec: &str) -> Vec<String> {
| ^^^^^^^^
|
associated functions `all` and `get_markdown_header` are never used:
src/api/models/metadata/addon_metadata.rs#L20
warning: associated functions `all` and `get_markdown_header` are never used
--> src/api/models/metadata/addon_metadata.rs:20:12
|
19 | impl AddonMetadataSource {
| ------------------------ associated functions in this implementation
20 | pub fn all() -> Vec<Self> {
| ^^^
...
33 | pub fn get_markdown_header() -> String {
| ^^^^^^^^^^^^^^^^^^^
|
method `update` is never used:
src/api/models/server/server_type.rs#L189
warning: method `update` is never used
--> src/api/models/server/server_type.rs:189:18
|
140 | impl ServerJar {
| -------------- method in this implementation
...
189 | pub async fn update(&mut self, app: &App) -> Result<bool> {
| ^^^^^^
|
methods `supports_datapacks`, `supports_mods`, and `supports_plugins` are never used:
src/api/models/server/server_flavor.rs#L15
warning: methods `supports_datapacks`, `supports_mods`, and `supports_plugins` are never used
--> src/api/models/server/server_flavor.rs:15:12
|
14 | impl ServerFlavor {
| ----------------- methods in this implementation
15 | pub fn supports_datapacks(&self) -> bool {
| ^^^^^^^^^^^^^^^^^^
...
22 | pub fn supports_mods(&self) -> bool {
| ^^^^^^^^^^^^^
...
29 | pub fn supports_plugins(&self) -> bool {
| ^^^^^^^^^^^^^^^^
|
associated function `from_addon` is never used:
src/api/models/packwiz/mod.rs#L58
warning: associated function `from_addon` is never used
--> src/api/models/packwiz/mod.rs:58:18
|
56 | impl PackwizMod {
| --------------- associated function in this implementation
57 | // TODO: incomplete
58 | pub async fn from_addon(app: &App, addon: &Addon) -> Result<(PathBuf, Self)> {
| ^^^^^^^^^^
|
associated function `from_steps` is never used:
src/api/models/packwiz/mod.rs#L51
warning: associated function `from_steps` is never used
--> src/api/models/packwiz/mod.rs:51:18
|
50 | impl PackwizModDownload {
| ----------------------- associated function in this implementation
51 | pub async fn from_steps(steps: &Vec<Step>) -> Self {
| ^^^^^^^^^^
|
associated function `from_addon_type` is never used:
src/api/models/packwiz/mod.rs#L41
warning: associated function `from_addon_type` is never used
--> src/api/models/packwiz/mod.rs:41:12
|
40 | impl PackwizModUpdate {
| --------------------- associated function in this implementation
41 | pub fn from_addon_type(addon_type: &AddonType) -> Result<Option<Self>> {
| ^^^^^^^^^^^^^^^
|
enum `LockfileMessage` is never used:
src/api/models/lockfile/mod.rs#L28
warning: enum `LockfileMessage` is never used
--> src/api/models/lockfile/mod.rs:28:10
|
28 | pub enum LockfileMessage {
| ^^^^^^^^^^^^^^^
|
method `to_path` is never used:
src/api/models/addon/addon_target.rs#L45
warning: method `to_path` is never used
--> src/api/models/addon/addon_target.rs:45:12
|
19 | impl AddonTarget {
| ---------------- method in this implementation
...
45 | pub fn to_path(&self) -> PathBuf {
| ^^^^^^^
|
enum `FileMessage` is never used:
src/api/app/logging/mod.rs#L7
warning: enum `FileMessage` is never used
--> src/api/app/logging/mod.rs:7:10
|
7 | pub enum FileMessage {
| ^^^^^^^^^^^
|
enum `Message` is never used:
src/api/app/logging/mod.rs#L3
warning: enum `Message` is never used
--> src/api/app/logging/mod.rs:3:10
|
3 | pub enum Message {
| ^^^^^^^
|
fields `mclogs` and `mcman_meta` are never read:
src/api/app/options/mod.rs#L37
warning: fields `mclogs` and `mcman_meta` are never read
--> src/api/app/options/mod.rs:37:9
|
23 | pub struct ApiUrls {
| ------- fields in this struct
...
37 | pub mclogs: String,
| ^^^^^^
...
41 | pub mcman_meta: String,
| ^^^^^^^^^^
|
method `save_changes` is never used:
src/api/app/io.rs#L23
warning: method `save_changes` is never used
--> src/api/app/io.rs:23:18
|
10 | impl App {
| -------- method in this implementation
...
23 | pub async fn save_changes(&self) -> Result<()> {
| ^^^^^^^^^^^^
|
method `reset_lockfile` is never used:
src/api/app/actions/lockfile/mod.rs#L8
warning: method `reset_lockfile` is never used
--> src/api/app/actions/lockfile/mod.rs:8:18
|
7 | impl App {
| -------- method in this implementation
8 | pub async fn reset_lockfile(&self) -> Result<()> {
| ^^^^^^^^^^^^^^
|
method `render_addon_metadata` is never used:
src/api/app/actions/markdown/mod.rs#L49
warning: method `render_addon_metadata` is never used
--> src/api/app/actions/markdown/mod.rs:49:18
|
7 | impl App {
| -------- method in this implementation
...
49 | pub async fn render_addon_metadata(&self, metadata: Vec<AddonMetadata>) -> Result<String> {
| ^^^^^^^^^^^^^^^^^^^^^
|
field `ci` is never read:
src/api/app/mod.rs#L39
warning: field `ci` is never read
--> src/api/app/mod.rs:39:9
|
31 | pub struct App {
| --- field in this struct
...
39 | pub ci: bool,
| ^^
|
= note: `#[warn(dead_code)]` on by default
|
unused variable: `relative_to`:
src/api/utils/update_writer.rs#L19
warning: unused variable: `relative_to`
--> src/api/utils/update_writer.rs:19:34
|
19 | pub fn from(source: &Source, relative_to: &Path) -> Result<Self> {
| ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_relative_to`
|
unused variable: `source`:
src/api/utils/update_writer.rs#L19
warning: unused variable: `source`
--> src/api/utils/update_writer.rs:19:17
|
19 | pub fn from(source: &Source, relative_to: &Path) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_source`
|
unreachable pattern:
src/api/models/markdown/render.rs#L40
warning: unreachable pattern
--> src/api/models/markdown/render.rs:40:25
|
40 | _ => meta.source.into_str().to_owned(),
| ^
|
= note: `#[warn(unreachable_patterns)]` on by default
|
unused variable: `url`:
src/api/models/addon/addon_type.rs#L71
warning: unused variable: `url`
--> src/api/models/addon/addon_type.rs:71:40
|
71 | ... AddonType::MavenArtifact { url, group, artifact, version, filename } => format!("Maven/{group}.{artifact} [{version}; {filename}]"),
| ^^^ help: try ignoring the field: `url: _`
|
unused variable: `url`:
src/api/models/addon/addon_type.rs#L70
warning: unused variable: `url`
--> src/api/models/addon/addon_type.rs:70:34
|
70 | AddonType::Jenkins { url, job, build, artifact } => format!("Jenkins/{job} [{build}; {artifact}]"),
| ^^^ help: try ignoring the field: `url: _`
|
unused import: `Digest`:
src/api/utils/hashing/curseforge.rs#L1
warning: unused import: `Digest`
--> src/api/utils/hashing/curseforge.rs:1:14
|
1 | use digest::{Digest, DynDigest, FixedOutput, FixedOutputReset, OutputSizeUser, Reset, Update};
| ^^^^^^
|
unused variable: `args`:
src/commands/export/packwiz.rs#L12
warning: unused variable: `args`
--> src/commands/export/packwiz.rs:12:33
|
12 | pub async fn run(app: Arc<App>, args: Args) -> Result<()> {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_args`
|
unused variable: `app`:
src/commands/export/packwiz.rs#L12
warning: unused variable: `app`
--> src/commands/export/packwiz.rs:12:18
|
12 | pub async fn run(app: Arc<App>, args: Args) -> Result<()> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_app`
|
unused variable: `args`:
src/commands/export/mrpack.rs#L12
warning: unused variable: `args`
--> src/commands/export/mrpack.rs:12:33
|
12 | pub async fn run(app: Arc<App>, args: Args) -> Result<()> {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_args`
|
unused variable: `app`:
src/commands/export/mrpack.rs#L12
warning: unused variable: `app`
--> src/commands/export/mrpack.rs:12:18
|
12 | pub async fn run(app: Arc<App>, args: Args) -> Result<()> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_app`
|
unused variable: `args`:
src/commands/update.rs#L12
warning: unused variable: `args`
--> src/commands/update.rs:12:33
|
12 | pub async fn run(app: Arc<App>, args: Args) -> Result<()> {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_args`
|
unused variable: `app`:
src/commands/update.rs#L12
warning: unused variable: `app`
--> src/commands/update.rs:12:18
|
12 | pub async fn run(app: Arc<App>, args: Args) -> Result<()> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_app`
|
unused variable: `args`:
src/commands/markdown/print.rs#L10
warning: unused variable: `args`
--> src/commands/markdown/print.rs:10:33
|
10 | pub async fn run(app: Arc<App>, args: Args) -> Result<()> {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_args`
|
unused variable: `app`:
src/commands/markdown/print.rs#L10
warning: unused variable: `app`
--> src/commands/markdown/print.rs:10:18
|
10 | pub async fn run(app: Arc<App>, args: Args) -> Result<()> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_app`
|
unreachable expression:
src/commands/markdown/print.rs#L13
warning: unreachable expression
--> src/commands/markdown/print.rs:13:5
|
11 | todo!();
| ------- any code following this expression is unreachable
12 |
13 | Ok(())
| ^^^^^^ unreachable expression
|
= note: `#[warn(unreachable_code)]` on by default
|
unused variable: `args`:
src/commands/markdown/render.rs#L10
warning: unused variable: `args`
--> src/commands/markdown/render.rs:10:33
|
10 | pub async fn run(app: Arc<App>, args: Args) -> Result<()> {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_args`
|
variable does not need to be mutable:
src/commands/init.rs#L73
warning: variable does not need to be mutable
--> src/commands/init.rs:73:9
|
73 | let mut nw = Network {
| ----^^
| |
| help: remove this `mut`
|
variable does not need to be mutable:
src/commands/init.rs#L48
warning: variable does not need to be mutable
--> src/commands/init.rs:48:9
|
48 | let mut server = Server {
| ----^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
|
unused variable: `event`:
src/api/ws/mod.rs#L84
warning: unused variable: `event`
--> src/api/ws/mod.rs:84:48
|
84 | pub async fn handle_event(self: Arc<Self>, event: MsgIn) -> Result<()> {
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_event`
|
unused variable: `loader`:
src/api/models/server/server_type.rs#L216
warning: unused variable: `loader`
--> src/api/models/server/server_type.rs:216:33
|
216 | ServerType::Forge { loader } => todo!(),
| ^^^^^^ help: try ignoring the field: `loader: _`
|
unused variable: `loader`:
src/api/models/server/server_type.rs#L215
warning: unused variable: `loader`
--> src/api/models/server/server_type.rs:215:36
|
215 | ServerType::NeoForge { loader } => todo!(),
| ^^^^^^ help: try ignoring the field: `loader: _`
|
unused variable: `installer`:
src/api/models/server/server_type.rs#L214
warning: unused variable: `installer`
--> src/api/models/server/server_type.rs:214:41
|
214 | ServerType::Quilt { loader, installer } => todo!(),
| ^^^^^^^^^ help: try ignoring the field: `installer: _`
|
unused variable: `loader`:
src/api/models/server/server_type.rs#L214
warning: unused variable: `loader`
--> src/api/models/server/server_type.rs:214:33
|
214 | ServerType::Quilt { loader, installer } => todo!(),
| ^^^^^^ help: try ignoring the field: `loader: _`
|
unused variable: `build`:
src/api/models/server/server_type.rs#L205
warning: unused variable: `build`
--> src/api/models/server/server_type.rs:205:34
|
205 | ServerType::Purpur { build } => todo!(),
| ^^^^^ help: try ignoring the field: `build: _`
|
unused variable: `steps`:
src/api/models/packwiz/mod.rs#L59
warning: unused variable: `steps`
--> src/api/models/packwiz/mod.rs:59:13
|
59 | let steps = addon.resolve_steps(app).await?;
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_steps`
|
unused variable: `steps`:
src/api/models/packwiz/mod.rs#L51
warning: unused variable: `steps`
--> src/api/models/packwiz/mod.rs:51:29
|
51 | pub async fn from_steps(steps: &Vec<Step>) -> Self {
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_steps`
|
unused variable: `rendered`:
src/api/app/actions/markdown/mod.rs#L59
warning: unused variable: `rendered`
--> src/api/app/actions/markdown/mod.rs:59:13
|
59 | let rendered = self.render_metadata(metadata).await?;
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_rendered`
|
unused variable: `app`:
src/api/models/packwiz/mod.rs#L72
warning: unused variable: `app`
--> src/api/models/packwiz/mod.rs:72:36
|
72 | pub async fn into_addon(&self, app: &App, target: AddonTarget) -> Result<Addon> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_app`
|
unused variable: `label`:
src/api/app/step/execute_java.rs#L13
warning: unused variable: `label`
--> src/api/app/step/execute_java.rs:13:9
|
13 | label: &str,
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_label`
|
unused variable: `loader`:
src/api/models/server/server_type.rs#L163
warning: unused variable: `loader`
--> src/api/models/server/server_type.rs:163:33
|
163 | ServerType::Forge { loader } => todo!(),
| ^^^^^^ help: try ignoring the field: `loader: _`
|
unused variable: `loader`:
src/api/models/server/server_type.rs#L162
warning: unused variable: `loader`
--> src/api/models/server/server_type.rs:162:36
|
162 | ServerType::NeoForge { loader } => todo!(),
| ^^^^^^ help: try ignoring the field: `loader: _`
|
unused variable: `build`:
src/api/models/server/server_type.rs#L159
warning: unused variable: `build`
--> src/api/models/server/server_type.rs:159:34
|
159 | ServerType::Purpur { build } => todo!(),
| ^^^^^ help: try ignoring the field: `build: _`
|
= note: `#[warn(unused_variables)]` on by default
|
unused import: `Path`:
src/commands/init.rs#L1
warning: unused import: `Path`
--> src/commands/init.rs:1:18
|
1 | use std::{path::{Path, PathBuf}, sync::Arc};
| ^^^^
|
unused import: `Path`:
src/commands/build.rs#L1
warning: unused import: `Path`
--> src/commands/build.rs:1:18
|
1 | use std::{path::{Path, PathBuf}, sync::Arc};
| ^^^^
|
unused import: `super::toml::read_toml`:
src/api/utils/update_writer.rs#L9
warning: unused import: `super::toml::read_toml`
--> src/api/utils/update_writer.rs:9:5
|
9 | use super::toml::read_toml;
| ^^^^^^^^^^^^^^^^^^^^^^
|
unused imports: `ModpackSource`, `ModpackType`, `SourceType`, and `app::App`:
src/api/utils/update_writer.rs#L7
warning: unused imports: `ModpackSource`, `ModpackType`, `SourceType`, and `app::App`
--> src/api/utils/update_writer.rs:7:18
|
7 | ...::{app::App, models::{mrpack::MRPackIndex, packwiz::{PackwizPack, PackwizPackIndex}, ModpackSource, ModpackType, Source, SourceType}};
| ^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^
|
unused import: `anyhow`:
src/api/utils/update_writer.rs#L3
warning: unused import: `anyhow`
--> src/api/utils/update_writer.rs:3:14
|
3 | use anyhow::{anyhow, Result};
| ^^^^^^
|
binding's name is too similar to existing binding:
src/api/utils/pathdiff.rs#L77
warning: binding's name is too similar to existing binding
--> src/api/utils/pathdiff.rs:77:17
|
77 | let mut itb = base.components();
| ^^^
|
note: existing binding defined here
--> src/api/utils/pathdiff.rs:76:17
|
76 | let mut ita = path.components();
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#similar_names
|
unused import: `DynDigest`:
src/api/utils/hashing/curseforge.rs#L1
warning: unused import: `DynDigest`
--> src/api/utils/hashing/curseforge.rs:1:22
|
1 | use digest::{Digest, DynDigest, FixedOutput, FixedOutputReset, OutputSizeUser, Reset, Update};
| ^^^^^^^^^
|
unused import: `anyhow`:
src/api/tools/java/mod.rs#L9
warning: unused import: `anyhow`
--> src/api/tools/java/mod.rs:9:14
|
9 | use anyhow::{anyhow, Context, Result};
| ^^^^^^
|
unused imports: `Deserialize` and `Serialize`:
src/api/sources/mcman_meta/mod.rs#L2
warning: unused imports: `Deserialize` and `Serialize`
--> src/api/sources/mcman_meta/mod.rs:2:13
|
2 | use serde::{Deserialize, Serialize};
| ^^^^^^^^^^^ ^^^^^^^^^
|
unused import: `anyhow`:
src/api/sources/mcman_meta/mod.rs#L1
warning: unused import: `anyhow`
--> src/api/sources/mcman_meta/mod.rs:1:14
|
1 | use anyhow::{anyhow, Result};
| ^^^^^^
|
unused import: `anyhow::Result`:
src/api/sources/hangar/models.rs#L3
warning: unused import: `anyhow::Result`
--> src/api/sources/hangar/models.rs:3:5
|
3 | use anyhow::Result;
| ^^^^^^^^^^^^^^
|
unused imports: `assets::*` and `rulematcher::*`:
src/api/sources/vanilla/mod.rs#L17
warning: unused imports: `assets::*` and `rulematcher::*`
--> src/api/sources/vanilla/mod.rs:17:16
|
17 | pub use self::{assets::*, manifest::*, rulematcher::*, version::*};
| ^^^^^^^^^ ^^^^^^^^^^^^^^
|
unused import: `network::*`:
src/api/models/legacy/mod.rs#L19
warning: unused import: `network::*`
--> src/api/models/legacy/mod.rs:19:9
|
19 | pub use network::*;
| ^^^^^^^^^^
|
unused import: `server_launcher::*`:
src/api/models/legacy/mod.rs#L18
warning: unused import: `server_launcher::*`
--> src/api/models/legacy/mod.rs:18:9
|
18 | pub use server_launcher::*;
| ^^^^^^^^^^^^^^^^^^
|
unused import: `bail`:
src/api/models/metadata/addon_metadata.rs#L1
warning: unused import: `bail`
--> src/api/models/metadata/addon_metadata.rs:1:14
|
1 | use anyhow::{bail, Result};
| ^^^^
|
unused import: `logging::*`:
src/api/app/mod.rs#L20
warning: unused import: `logging::*`
--> src/api/app/mod.rs:20:9
|
20 | pub use logging::*;
| ^^^^^^^^^^
|
redundant else block:
src/api/app/step/cache_check.rs#L69
warning: redundant else block
--> src/api/app/step/cache_check.rs:69:28
|
69 | } else {
| ____________________________^
70 | | // hash mismatch
71 | | // TODO: print warning
72 | | println!("WARNING Hash mismatch: {}", metadata.filename);
73 | | tokio::fs::remove_file(&output_path).await.context("hash mismatch remove file")?;
74 | | }
| |_____________________^
|
= help: remove the `else` block and move the contents out
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_else
= note: `-W clippy::redundant-else` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::redundant_else)]`
|
unused import: `lockfile::Lockfile`:
src/api/app/io.rs#L6
warning: unused import: `lockfile::Lockfile`
--> src/api/app/io.rs:6:27
|
6 | use crate::api::{models::{lockfile::Lockfile, network::{Network, NETWORK_TOML}, server::{Server, SERVER_TOML}}, utils::toml::{try_find_to...
| ^^^^^^^^^^^^^^^^^^
|
unused import: `tokio::sync::RwLock`:
src/api/app/io.rs#L4
warning: unused import: `tokio::sync::RwLock`
--> src/api/app/io.rs:4:5
|
4 | use tokio::sync::RwLock;
| ^^^^^^^^^^^^^^^^^^^
|
unused import: `std::sync::Arc`:
src/api/app/io.rs#L1
warning: unused import: `std::sync::Arc`
--> src/api/app/io.rs:1:5
|
1 | use std::sync::Arc;
| ^^^^^^^^^^^^^^
|
binding's name is too similar to existing binding:
src/api/app/http.rs#L22
warning: binding's name is too similar to existing binding
--> src/api/app/http.rs:22:13
|
22 | let res = req.send().await?.error_for_status()?;
| ^^^
|
note: existing binding defined here
--> src/api/app/http.rs:18:13
|
18 | let req = self.http_client.get(url.as_str());
| ^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#similar_names
= note: `-W clippy::similar-names` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::similar_names)]`
|
unused import: `path::Path`:
src/main.rs#L1
warning: unused import: `path::Path`
--> src/main.rs:1:11
|
1 | use std::{path::Path, sync::Arc};
| ^^^^^^^^^^
|
= 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/
|
clippy
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
build (ubuntu-latest)
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions/upload-artifact@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
build (windows-latest)
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions/upload-artifact@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Deprecation notice: v1, v2, and v3 of the artifact actions
The following artifacts were uploaded using a version of actions/upload-artifact that is scheduled for deprecation: "mcman-ubuntu-latest", "mcman-windows-latest".
Please update your workflow to use v4 of the artifact actions.
Learn more: https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
mcman-ubuntu-latest
Expired
|
7.71 MB |
|
mcman-windows-latest
Expired
|
12 MB |
|