Skip to content

Commit

Permalink
fix: clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
amv-dev committed Mar 28, 2021
1 parent 5d55110 commit a55bac9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ impl From<Action> for Option<ValueType> {
}
}

impl<T: Into<Action> + Copy> From<&T> for Action {
impl<T: Into<Self> + Copy> From<&T> for Action {
fn from(value: &T) -> Self {
(*value).into()
}
Expand Down
3 changes: 2 additions & 1 deletion src/core/indicator/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use serde::{Deserialize, Serialize};
/// `Indicator` may return up to 4 signals and 4 raw values at each step
#[derive(Clone, Copy)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[allow(clippy::use_self)]
pub struct IndicatorResult {
signals: [Action; IndicatorResult::SIZE],
values: [ValueType; IndicatorResult::SIZE],
Expand Down Expand Up @@ -93,8 +94,8 @@ impl IndicatorResult {
let length = (values_length as u8, signals_length as u8);

Self {
values,
signals,
values,
length,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/methods/collapse_timeframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ mod tests {
for length in 2..10 {
let mut method = TestingMethod::new(length, &candles[0]).unwrap();

let converted = candles.iter().map(|x| method.next(x)).filter_map(|x| x);
let converted = candles.iter().flat_map(|x| method.next(x));

candles
.windows(length)
Expand Down

0 comments on commit a55bac9

Please sign in to comment.