Skip to content

maven, forge and neoforge

Sign in for the full log view
GitHub Actions / clippy failed Aug 6, 2023 in 0s

clippy

4 errors, 5 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 4
Warning 5
Note 0
Help 0

Versions

  • rustc 1.71.1 (eb26296b5 2023-08-03)
  • cargo 1.71.1 (7f1d04c00 2023-07-29)
  • clippy 0.1.71 (eb26296 2023-08-03)

Annotations

Check warning on line 86 in src/util/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant closure

warning: redundant closure
  --> src/util/mod.rs:86:21
   |
86 |     list.last().map(|v| v.to_string())
   |                     ^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::string::ToString::to_string`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
   = note: `#[warn(clippy::redundant_closure_for_method_calls)]` implied by `#[warn(clippy::pedantic)]`

Check warning on line 78 in src/util/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this argument is passed by value, but not consumed in the function body

warning: this argument is passed by value, but not consumed in the function body
  --> src/util/mod.rs:78:32
   |
78 | pub fn get_latest_semver(list: Vec<String>) -> Option<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
   = note: `#[warn(clippy::needless_pass_by_value)]` implied by `#[warn(clippy::pedantic)]`

Check failure on line 99 in src/util/maven_import.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

single-character string constant used as pattern

error: single-character string constant used as pattern
  --> src/util/maven_import.rs:99:16
   |
99 |         .split("%")
   |                ^^^ help: try using a `char` instead: `'%'`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern

Check failure on line 68 in src/util/maven_import.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

error: the borrowed expression implements the required traits
  --> src/util/maven_import.rs:68:27
   |
68 |     let imp = imp.replace(&[' ', '(', ')', '"'], "");
   |                           ^^^^^^^^^^^^^^^^^^^^^ help: change this to: `[' ', '(', ')', '"']`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
   = note: `#[deny(clippy::needless_borrow)]` implied by `#[deny(clippy::all)]`

Check failure on line 109 in src/sources/maven.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this creates an owned instance just for comparison

error: this creates an owned instance just for comparison
   --> src/sources/maven.rs:109:17
    |
109 |                 v.to_owned() == &id
    |                 ^^^^^^^^^^^^ help: try: `*v`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned
    = note: `#[deny(clippy::cmp_owned)]` implied by `#[deny(clippy::all)]`

Check warning on line 115 in src/sources/maven.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

implicitly cloning a `String` by calling `to_owned` on its dereferenced type

warning: implicitly cloning a `String` by calling `to_owned` on its dereferenced type
   --> src/sources/maven.rs:108:13
    |
108 | /             versions.iter().find(|v| {
109 | |                 v.to_owned() == &id
110 | |             }).or_else(|| {
111 | |                 versions.iter().find(|v| {
...   |
114 | |             }).ok_or(anyhow!("Couldn't resolve maven artifact version"))?
115 | |             .to_owned()
    | |_______________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
help: consider using
    |
108 ~             versions.iter().find(|v| {
109 +                 v.to_owned() == &id
110 +             }).or_else(|| {
111 +                 versions.iter().find(|v| {
112 +                     v.contains(&id)
113 +                 })
114 +             }).ok_or(anyhow!("Couldn't resolve maven artifact version"))?.clone()
    |

Check failure on line 103 in src/sources/maven.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

single-character string constant used as pattern

error: single-character string constant used as pattern
   --> src/sources/maven.rs:103:30
    |
103 |         id => if id.contains("$") {
    |                              ^^^ help: try using a `char` instead: `'$'`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
note: the lint level is defined here
   --> src/main.rs:1:9
    |
1   | #![deny(clippy::all)]
    |         ^^^^^^^^^^^
    = note: `#[deny(clippy::single_char_pattern)]` implied by `#[deny(clippy::all)]`

Check warning on line 98 in src/sources/github.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

implicitly cloning a `GithubAsset` by calling `to_owned` on its dereferenced type

warning: implicitly cloning a `GithubAsset` by calling `to_owned` on its dereferenced type
  --> src/sources/github.rs:98:8
   |
98 |     Ok(resolved_asset.to_owned())
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `resolved_asset.clone()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone

Check warning on line 112 in src/model/downloadable/markdown.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

implicitly cloning a `String` by calling `to_owned` on its dereferenced type

warning: implicitly cloning a `String` by calling `to_owned` on its dereferenced type
   --> src/model/downloadable/markdown.rs:112:50
    |
112 |                 map.insert("Version".to_owned(), version.to_owned());
    |                                                  ^^^^^^^^^^^^^^^^^^ help: consider using: `version.clone()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
note: the lint level is defined here
   --> src/main.rs:2:9
    |
2   | #![warn(clippy::pedantic)]
    |         ^^^^^^^^^^^^^^^^
    = note: `#[warn(clippy::implicit_clone)]` implied by `#[warn(clippy::pedantic)]`