Clippy check #25
Annotations
2 errors and 14 warnings
useless lint attribute:
src/main.rs#L5
error: useless lint attribute
--> src/main.rs:5:1
|
5 | #[allow(dead_code)]
| ^^^^^^^^^^^^^^^^^^^ help: if you just forgot a `!`, use: `#![allow(dead_code)]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_attribute
= note: `#[deny(clippy::useless_attribute)]` on by default
|
clippy_check
Clippy had exited with the 101 exit code
|
unused `std::result::Result` that must be used:
src/main.rs#L172
warning: unused `std::result::Result` that must be used
--> src/main.rs:172:9
|
172 | csv_writer.serialize(score);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
172 | let _ = csv_writer.serialize(score);
| +++++++
|
useless conversion to the same type: `usize`:
src/main.rs#L49
warning: useless conversion to the same type: `usize`
--> src/main.rs:49:31
|
49 | r_mass: vec![0.0; usize::try_from(n_nodes).unwrap()],
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider removing `usize::try_from()`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
|
useless conversion to the same type: `usize`:
src/main.rs#L48
warning: useless conversion to the same type: `usize`
--> src/main.rs:48:31
|
48 | l_mass: vec![0.0; usize::try_from(n_nodes).unwrap()],
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider removing `usize::try_from()`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
|
useless conversion to the same type: `usize`:
src/main.rs#L47
warning: useless conversion to the same type: `usize`
--> src/main.rs:47:34
|
47 | threshold: vec![0.0; usize::try_from(n_branches).unwrap()],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider removing `usize::try_from()`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
|
useless conversion to the same type: `usize`:
src/main.rs#L46
warning: useless conversion to the same type: `usize`
--> src/main.rs:46:45
|
46 | feature: vec![String::from(""); usize::try_from(n_branches).unwrap()],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider removing `usize::try_from()`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
|
name `HST` contains a capitalized acronym:
src/main.rs#L27
warning: name `HST` contains a capitalized acronym
--> src/main.rs:27:8
|
27 | struct HST {
| ^^^ help: consider making the acronym lowercase, except the initial letter: `Hst`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
= note: `#[warn(clippy::upper_case_acronyms)]` on by default
|
unused variable: `i`:
src/main.rs#L121
warning: unused variable: `i`
--> src/main.rs:121:10
|
121 | for (i, transaction) in transactions.enumerate() {
| ^ help: if this is intentional, prefix it with an underscore: `_i`
|
= note: `#[warn(unused_variables)]` on by default
|
using `clone` on type `F` which implements the `Copy` trait:
src/metrics/confusion.rs#L150
warning: using `clone` on type `F` which implements the `Copy` trait
--> src/metrics/confusion.rs:150:9
|
150 | / self.data
151 | | .get(label)
152 | | .unwrap_or(&HashMap::new())
153 | | .get(label)
154 | | .unwrap_or(&F::zero())
155 | | .clone()
| |____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
help: try dereferencing it
|
150 ~ *self.data
151 + .get(label)
152 + .unwrap_or(&HashMap::new())
153 + .get(label)
154 + .unwrap_or(&F::zero())
|
|
using `clone` on type `F` which implements the `Copy` trait:
src/metrics/confusion.rs#L146
warning: using `clone` on type `F` which implements the `Copy` trait
--> src/metrics/confusion.rs:146:9
|
146 | self.sum_col.get(label).unwrap_or(&F::zero()).clone()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self.sum_col.get(label).unwrap_or(&F::zero())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `#[warn(clippy::clone_on_copy)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/metrics/accuracy.rs#L60
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/metrics/accuracy.rs:60:52
|
60 | .max_by(|a, b| a.1.partial_cmp(&b.1).unwrap())
| ^^^^ help: change this to: `b.1`
|
= 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/metrics/accuracy.rs#L37
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/metrics/accuracy.rs:37:52
|
37 | .max_by(|a, b| a.1.partial_cmp(&b.1).unwrap())
| ^^^^ help: change this to: `b.1`
|
= 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/common.rs#L218
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/common.rs:218:52
|
218 | .max_by(|a, b| a.1.partial_cmp(&b.1).unwrap())
| ^^^^ help: change this to: `b.1`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
method `from_iter` can be confused for the standard trait method `std::iter::FromIterator::from_iter`:
src/common.rs#L77
warning: method `from_iter` can be confused for the standard trait method `std::iter::FromIterator::from_iter`
--> src/common.rs:77:5
|
77 | / pub fn from_iter<I: IntoClassifierTargetIter>(iter: I) -> Box<dyn Iterator<Item = Self>> {
78 | | iter.into_classifier_target_iter()
79 | | }
| |_____^
|
= help: consider implementing the trait `std::iter::FromIterator` or choosing a less ambiguous method name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
= note: `#[warn(clippy::should_implement_trait)]` on by default
|
clippy_check
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/
|