Skip to content
GitHub Actions / clippy succeeded Oct 5, 2023 in 0s

clippy

10 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 10
Note 0
Help 0

Versions

  • rustc 1.72.1 (d5c2e9c34 2023-09-13)
  • cargo 1.72.1 (103a7ff2e 2023-08-15)
  • clippy 0.1.72 (d5c2e9c 2023-09-13)

Annotations

Check warning on line 59 in src/metrics/rocauc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

name `ROCAUC` contains a capitalized acronym

warning: name `ROCAUC` contains a capitalized acronym
  --> src/metrics/rocauc.rs:59:8
   |
59 | struct ROCAUC<F: Float + FromPrimitive + AddAssign + SubAssign + MulAssign + DivAssign> {
   |        ^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Rocauc`
   |
   = 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

Check warning on line 155 in src/metrics/confusion.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `F` which implements the `Copy` trait

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())
    |

Check warning on line 146 in src/metrics/confusion.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `F` which implements the `Copy` trait

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

Check warning on line 217 in src/common.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/common.rs:217:52
    |
217 |                     .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

Check warning on line 79 in src/common.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

method `from_iter` can be confused for the standard trait method `std::iter::FromIterator::from_iter`

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

Check warning on line 66 in src/metrics/rocauc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

associated function `new` is never used

warning: associated function `new` is never used
  --> src/metrics/rocauc.rs:66:12
   |
65 | impl<F: Float + FromPrimitive + AddAssign + SubAssign + MulAssign + DivAssign> ROCAUC<F> {
   | ---------------------------------------------------------------------------------------- associated function in this implementation
66 |     pub fn new(n_threshold: Option<usize>, pos_val: ClassifierTarget) -> Self {
   |            ^^^

Check warning on line 12 in src/metrics/accuracy.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

associated function `new` is never used

warning: associated function `new` is never used
  --> src/metrics/accuracy.rs:12:12
   |
11 | impl<F: Float + FromPrimitive + AddAssign + SubAssign + MulAssign + DivAssign> Accuracy<F> {
   | ------------------------------------------------------------------------------------------ associated function in this implementation
12 |     pub fn new() -> Self {
   |            ^^^
   |
   = note: `#[warn(dead_code)]` on by default

Check warning on line 88 in src/metrics/rocauc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant field names in struct initialization

warning: redundant field names in struct initialization
  --> src/metrics/rocauc.rs:88:13
   |
88 |             cms: cms,
   |             ^^^^^^^^ help: replace it with: `cms`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

Check warning on line 87 in src/metrics/rocauc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant field names in struct initialization

warning: redundant field names in struct initialization
  --> src/metrics/rocauc.rs:87:13
   |
87 |             thresholds: thresholds,
   |             ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `thresholds`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

Check warning on line 86 in src/metrics/rocauc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant field names in struct initialization

warning: redundant field names in struct initialization
  --> src/metrics/rocauc.rs:86:13
   |
86 |             pos_val: pos_val,
   |             ^^^^^^^^^^^^^^^^ help: replace it with: `pos_val`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
   = note: `#[warn(clippy::redundant_field_names)]` on by default