Skip to content

Merge pull request #9 from MarcoDiFrancesco/main #55

Merge pull request #9 from MarcoDiFrancesco/main

Merge pull request #9 from MarcoDiFrancesco/main #55

Triggered via push April 5, 2024 14:44
Status Failure
Total duration 48s
Artifacts

clippy_check.yml

on: push
clippy_check
39s
clippy_check
Fit to window
Zoom out
Zoom in

Annotations

2 errors and 22 warnings
type `stream::data_stream::Data<F>` implements inherent method `to_string(&self) -> String` which shadows the implementation of `Display`: src/stream/data_stream.rs#L73
error: type `stream::data_stream::Data<F>` implements inherent method `to_string(&self) -> String` which shadows the implementation of `Display` --> src/stream/data_stream.rs:73:5 | 73 | / pub fn to_string(&self) -> String { 74 | | match self { 75 | | Data::Scalar(v) => v.to_string(), 76 | | Data::Int(v) => v.to_string(), ... | 79 | | } 80 | | } | |_____^ | = help: remove the inherent method from type `stream::data_stream::Data<F>` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string_shadow_display = note: `#[deny(clippy::inherent_to_string_shadow_display)]` on by default
clippy_check
Clippy had exited with the 101 exit code
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
use of `or_insert_with` to construct default value: src/metrics/confusion.rs#L108
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
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
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
this expression creates a reference which is immediately dereferenced by the compiler: src/anomaly/half_space_tree.rs#L148
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/anomaly/half_space_tree.rs:148:17 | 148 | &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
unneeded `return` statement: src/anomaly/half_space_tree.rs#L229
warning: unneeded `return` statement --> src/anomaly/half_space_tree.rs:229:9 | 229 | 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` | 229 - return None; 229 + None |
manual implementation of `Option::map`: src/anomaly/half_space_tree.rs#L116
warning: manual implementation of `Option::map` --> src/anomaly/half_space_tree.rs:116:21 | 116 | let trees = if let Some(features) = features { | _____________________^ 117 | | Some(Trees::new(n_trees, height, &features, &mut rng)) 118 | | } else { 119 | | None 120 | | }; | |_________^ 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
redundant field names in struct initialization: src/metrics/rocauc.rs#L89
warning: redundant field names in struct initialization --> src/metrics/rocauc.rs:89:13 | 89 | 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
redundant field names in struct initialization: src/metrics/rocauc.rs#L88
warning: redundant field names in struct initialization --> src/metrics/rocauc.rs:88:13 | 88 | 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
redundant field names in struct initialization: src/metrics/rocauc.rs#L87
warning: redundant field names in struct initialization --> src/metrics/rocauc.rs:87:13 | 87 | 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
unused import: `super::*`: src/anomaly/half_space_tree.rs#L279
warning: unused import: `super::*` --> src/anomaly/half_space_tree.rs:279:9 | 279 | use super::*; | ^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
redundant field names in struct initialization: src/anomaly/half_space_tree.rs#L132
warning: redundant field names in struct initialization --> src/anomaly/half_space_tree.rs:132:13 | 132 | 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
redundant field names in struct initialization: src/anomaly/half_space_tree.rs#L130
warning: redundant field names in struct initialization --> src/anomaly/half_space_tree.rs:130:13 | 130 | 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
redundant field names in struct initialization: src/anomaly/half_space_tree.rs#L129
warning: redundant field names in struct initialization --> src/anomaly/half_space_tree.rs:129:13 | 129 | 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
redundant field names in struct initialization: src/anomaly/half_space_tree.rs#L128
warning: redundant field names in struct initialization --> src/anomaly/half_space_tree.rs:128:13 | 128 | 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
redundant field names in struct initialization: src/anomaly/half_space_tree.rs#L127
warning: redundant field names in struct initialization --> src/anomaly/half_space_tree.rs:127:13 | 127 | 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
redundant field names in struct initialization: src/anomaly/half_space_tree.rs#L125
warning: redundant field names in struct initialization --> src/anomaly/half_space_tree.rs:125:13 | 125 | 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
redundant field names in struct initialization: src/anomaly/half_space_tree.rs#L124
warning: redundant field names in struct initialization --> src/anomaly/half_space_tree.rs:124:13 | 124 | 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
redundant field names in struct initialization: src/anomaly/half_space_tree.rs#L122
warning: redundant field names in struct initialization --> src/anomaly/half_space_tree.rs:122:13 | 122 | 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
clippy_check
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
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/