Skip to content

Merge branch 'ahnentafel' of https://github.com/online-ml/light-river…

Sign in for the full log view
GitHub Actions / clippy succeeded Dec 14, 2023 in 0s

clippy

21 warnings

Details

Results

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

Versions

  • rustc 1.74.1 (a28077b28 2023-12-04)
  • cargo 1.74.1 (ecb9851af 2023-10-18)
  • clippy 0.1.74 (a28077b 2023-12-04)

Annotations

Check warning on line 67 in src/stream/data_stream.rs

@github-actions github-actions / clippy

implementation of inherent method `to_string(&self) -> String` for type `stream::data_stream::Data<F>`

warning: implementation of inherent method `to_string(&self) -> String` for type `stream::data_stream::Data<F>`
  --> src/stream/data_stream.rs:60:5
   |
60 | /     pub fn to_string(&self) -> String {
61 | |         match self {
62 | |             Data::Scalar(v) => v.to_string(),
63 | |             Data::Int(v) => v.to_string(),
...  |
66 | |         }
67 | |     }
   | |_____^
   |
   = help: implement trait `Display` for type `stream::data_stream::Data<F>` instead
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string
   = note: `#[warn(clippy::inherent_to_string)]` on by default

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

@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

@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 108 in src/metrics/confusion.rs

@github-actions github-actions / clippy

use of `or_insert_with` to construct default value

warning: use of `or_insert_with` to construct default value
   --> src/metrics/confusion.rs:108:14
    |
108 |             .or_insert_with(HashMap::new)
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
    = note: `#[warn(clippy::unwrap_or_default)]` on by default

Check warning on line 218 in src/common.rs

@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

Check warning on line 79 in src/common.rs

@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 147 in src/anomaly/half_space_tree.rs

@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/anomaly/half_space_tree.rs:147:17
    |
147 |                 &self.features.as_ref().unwrap(),
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.features.as_ref().unwrap()`
    |
    = 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 228 in src/anomaly/half_space_tree.rs

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> src/anomaly/half_space_tree.rs:228:9
    |
228 |         return None;
    |         ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
    = note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
    |
228 -         return None;
228 +         None
    |

Check warning on line 119 in src/anomaly/half_space_tree.rs

@github-actions github-actions / clippy

manual implementation of `Option::map`

warning: manual implementation of `Option::map`
   --> src/anomaly/half_space_tree.rs:115:21
    |
115 |           let trees = if let Some(features) = features {
    |  _____________________^
116 | |             Some(Trees::new(n_trees, height, &features, &mut rng))
117 | |         } else {
118 | |             None
119 | |         };
    | |_________^ help: try: `features.map(|features| Trees::new(n_trees, height, &features, &mut rng))`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map
    = note: `#[warn(clippy::manual_map)]` on by default

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

@github-actions github-actions / clippy

redundant field names in struct initialization

warning: redundant field names in struct initialization
  --> src/metrics/rocauc.rs:90:13
   |
90 |             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 89 in src/metrics/rocauc.rs

@github-actions github-actions / clippy

redundant field names in struct initialization

warning: redundant field names in struct initialization
  --> src/metrics/rocauc.rs:89:13
   |
89 |             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 88 in src/metrics/rocauc.rs

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

Check warning on line 278 in src/anomaly/half_space_tree.rs

@github-actions github-actions / clippy

unused import: `super::*`

warning: unused import: `super::*`
   --> src/anomaly/half_space_tree.rs:278:9
    |
278 |     use super::*;
    |         ^^^^^^^^
    |
    = note: `#[warn(unused_imports)]` on by default

Check warning on line 131 in src/anomaly/half_space_tree.rs

@github-actions github-actions / clippy

redundant field names in struct initialization

warning: redundant field names in struct initialization
   --> src/anomaly/half_space_tree.rs:131:13
    |
131 |             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

Check warning on line 129 in src/anomaly/half_space_tree.rs

@github-actions github-actions / clippy

redundant field names in struct initialization

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

Check warning on line 128 in src/anomaly/half_space_tree.rs

@github-actions github-actions / clippy

redundant field names in struct initialization

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

Check warning on line 127 in src/anomaly/half_space_tree.rs

@github-actions github-actions / clippy

redundant field names in struct initialization

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

Check warning on line 126 in src/anomaly/half_space_tree.rs

@github-actions github-actions / clippy

redundant field names in struct initialization

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

Check warning on line 124 in src/anomaly/half_space_tree.rs

@github-actions github-actions / clippy

redundant field names in struct initialization

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

Check warning on line 123 in src/anomaly/half_space_tree.rs

@github-actions github-actions / clippy

redundant field names in struct initialization

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

Check warning on line 121 in src/anomaly/half_space_tree.rs

@github-actions github-actions / clippy

redundant field names in struct initialization

warning: redundant field names in struct initialization
   --> src/anomaly/half_space_tree.rs:121:13
    |
121 |             window_size: window_size,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `window_size`
    |
    = 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