Run cargo fmt #9
clippy
5 errors
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 5 |
Warning | 0 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.75.0-nightly (187b8131d 2023-10-03)
- cargo 1.75.0-nightly (59596f0f3 2023-09-29)
- clippy 0.1.74 (187b813 2023-10-03)
Annotations
Check failure on line 52 in src/main.rs
github-actions / clippy
called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
--> src/main.rs:47:13
|
47 | // the_match.map(|it| {
48 | || required.insert(it.to_string());
49 | || if version.default.unwrap_or(false) {
50 | || default = Some(it.to_string());
51 | || }
52 | || });
| ||______________^- help: try: `if let Some(it) = the_match { ... }`
| |______________|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn
Check failure on line 62 in src/sdkman/candidate.rs
github-actions / clippy
called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
--> src/sdkman/candidate.rs:59:21
|
59 | / line.split_whitespace()
60 | | .filter(|word| *word != "*" && *word != ">")
61 | | .last()
62 | | .map(|word| versions.push(word.to_string()));
| |____________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn
= note: `-D clippy::option-map-unit-fn` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::option_map_unit_fn)]`
help: try
|
59 ~ if let Some(word) = line.split_whitespace()
60 + .filter(|word| *word != "*" && *word != ">")
61 + .last() { versions.push(word.to_string()) }
|
Check failure on line 48 in src/rules/mod.rs
github-actions / clippy
this expression can be written more simply using `.retain()`
error: this expression can be written more simply using `.retain()`
--> src/rules/mod.rs:45:13
|
45 | / matches = matches
46 | | .into_iter()
47 | | .filter(|it| !exclude_pattern.is_match(it))
48 | | .collect();
| |__________________________^ help: consider calling `.retain()` instead: `matches.retain(|it| !exclude_pattern.is_match(it))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain
= note: `-D clippy::manual-retain` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::manual_retain)]`
Check failure on line 44 in src/rules/mod.rs
github-actions / clippy
use of `expect` followed by a function call
error: use of `expect` followed by a function call
--> src/rules/mod.rs:44:18
|
44 | .expect(format!("Invalid regex for {}: {}", name, exclude.join("|")).as_str());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Invalid regex for {}: {}", name, exclude.join("|")))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
Check failure on line 35 in src/rules/mod.rs
github-actions / clippy
use of `expect` followed by a function call
error: use of `expect` followed by a function call
--> src/rules/mod.rs:35:14
|
35 | .expect(format!("Invalid regex for {}: {}", name, self.pattern).as_str());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Invalid regex for {}: {}", name, self.pattern))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
= note: `-D clippy::expect-fun-call` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::expect_fun_call)]`