Skip to content

start using arrays for representing trees #24

start using arrays for representing trees

start using arrays for representing trees #24

This check has been archived and is scheduled for deletion. Learn more about checks retention
GitHub Actions / clippy failed Oct 4, 2023 in 0s

clippy

1 error, 17 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 1
Warning 17
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 50 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `usize`

warning: useless conversion to the same type: `usize`
  --> src/main.rs:50:31
   |
50 |             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

Check warning on line 49 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `usize`

warning: useless conversion to the same type: `usize`
  --> src/main.rs:49:31
   |
49 |             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

Check warning on line 48 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `usize`

warning: useless conversion to the same type: `usize`
  --> src/main.rs:48:34
   |
48 |             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

Check warning on line 47 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `usize`

warning: useless conversion to the same type: `usize`
  --> src/main.rs:47:45
   |
47 |             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

Check warning on line 26 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

name `HST` contains a capitalized acronym

warning: name `HST` contains a capitalized acronym
  --> src/main.rs:26:8
   |
26 | 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

Check failure on line 1 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless lint attribute

error: useless lint attribute
 --> src/main.rs:1:1
  |
1 | #[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

Check warning on line 29 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

fields `l_mass` and `r_mass` are never read

warning: fields `l_mass` and `r_mass` are never read
  --> src/main.rs:29:5
   |
26 | struct HST {
   |        --- fields in this struct
...
29 |     l_mass: Vec<f32>,
   |     ^^^^^^
30 |     r_mass: Vec<f32>,
   |     ^^^^^^
   |
   = note: `HST` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis

Check warning on line 21 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

function `right_child` is never used

warning: function `right_child` is never used
  --> src/main.rs:21:4
   |
21 | fn right_child(node: u32) -> u32 {
   |    ^^^^^^^^^^^

Check warning on line 16 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

function `left_child` is never used

warning: function `left_child` is never used
  --> src/main.rs:16:4
   |
16 | fn left_child(node: u32) -> u32 {
   |    ^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

Check warning on line 79 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `window_size`

warning: unused variable: `window_size`
  --> src/main.rs:79:9
   |
79 |     let window_size: u32 = 100;
   |         ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_window_size`
   |
   = note: `#[warn(unused_variables)]` on by default

Check warning on line 10 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused import: `std::collections::HashMap`

warning: unused import: `std::collections::HashMap`
  --> src/main.rs:10:5
   |
10 | use std::collections::HashMap;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` 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 60 in src/metrics/accuracy.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/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

Check warning on line 37 in src/metrics/accuracy.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/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

Check warning on line 218 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: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

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