From 44cc37173ca987775393da26540394b6868798c6 Mon Sep 17 00:00:00 2001 From: amv-dev Date: Sun, 28 Jul 2024 14:50:04 +0500 Subject: [PATCH] fix: rustc 1.80 support --- src/core/method.rs | 2 +- src/indicators/awesome_oscillator.rs | 4 ++-- src/indicators/chande_kroll_stop.rs | 2 +- src/indicators/donchian_channel.rs | 6 +++--- src/indicators/ease_of_movement.rs | 4 ++-- src/indicators/elders_force_index.rs | 4 ++-- src/indicators/envelopes.rs | 4 ++-- src/indicators/fisher_transform.rs | 2 +- src/indicators/hull_moving_average.rs | 4 ++-- src/indicators/ichimoku_cloud.rs | 12 ++++++------ src/indicators/kaufman.rs | 6 +++--- src/indicators/klinger_volume_oscillator.rs | 8 ++++---- src/indicators/know_sure_thing.rs | 4 ++-- src/indicators/macd.rs | 8 ++++---- src/indicators/momentum_index.rs | 4 ++-- src/indicators/money_flow_index.rs | 8 ++++---- src/indicators/parabolic_sar.rs | 4 ++-- src/indicators/trend_strength_index.rs | 4 ++-- src/indicators/trix.rs | 12 ++++++------ src/indicators/true_strength_index.rs | 12 ++++++------ src/indicators/woodies_cci.rs | 4 ++-- src/lib.rs | 2 +- 22 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/core/method.rs b/src/core/method.rs index 272d0f0..b375c75 100644 --- a/src/core/method.rs +++ b/src/core/method.rs @@ -114,7 +114,7 @@ pub trait Method { where Self: Sized, { - (std::mem::size_of::(), std::mem::align_of::()) + (size_of::(), align_of::()) } /// Iterates the `Method` over the given `inputs` slice and returns `Vec` of output values. diff --git a/src/indicators/awesome_oscillator.rs b/src/indicators/awesome_oscillator.rs index b6ff8dc..0b8868a 100644 --- a/src/indicators/awesome_oscillator.rs +++ b/src/indicators/awesome_oscillator.rs @@ -21,8 +21,8 @@ use crate::methods::{Cross, ReversalSignal}; /// # 2 signals /// /// * "Twin Peaks". When `value` is below zero line and we got `conseq_peaks` lower peaks, then returns full positive signal -/// When `value` is above zero line and we got `conseq_peaks` higher peaks, then returns full negative signal. -/// Otherwise gives no signal. +/// When `value` is above zero line and we got `conseq_peaks` higher peaks, then returns full negative signal. +/// Otherwise gives no signal. /// * Gives signal when `values` crosses zero line #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] diff --git a/src/indicators/chande_kroll_stop.rs b/src/indicators/chande_kroll_stop.rs index 7be1613..3d84789 100644 --- a/src/indicators/chande_kroll_stop.rs +++ b/src/indicators/chande_kroll_stop.rs @@ -18,7 +18,7 @@ use crate::methods::{CrossAbove, Highest, Lowest}; /// # 3 values /// /// * `stop long` -/// Range of values is the same as the range of the `source` values. +/// Range of values is the same as the range of the `source` values. /// /// * `source` value /// diff --git a/src/indicators/donchian_channel.rs b/src/indicators/donchian_channel.rs index 54ce651..1e44050 100644 --- a/src/indicators/donchian_channel.rs +++ b/src/indicators/donchian_channel.rs @@ -30,9 +30,9 @@ use crate::methods::{Highest, Lowest}; /// # 1 signal /// /// * When [`high`] value hits `upper bound`, returns full buy signal. -/// When [`low`] value hits `lower bound`, returns full sell signal. -/// Otherwise returns no signal. -/// If both values hit both bounds, returns no signal. +/// When [`low`] value hits `lower bound`, returns full sell signal. +/// Otherwise returns no signal. +/// If both values hit both bounds, returns no signal. /// /// [`high`]: crate::core::OHLCV::high /// [`low`]: crate::core::OHLCV::low diff --git a/src/indicators/ease_of_movement.rs b/src/indicators/ease_of_movement.rs index 5000b2d..6a93f75 100644 --- a/src/indicators/ease_of_movement.rs +++ b/src/indicators/ease_of_movement.rs @@ -23,8 +23,8 @@ use crate::methods::Cross; /// # 1 signal /// /// * Signal 1 appears when `main value` crosses zero line. -/// When `main value` crosses zero line upwards, returns full buy signal. -/// When `main value` crosses zero line downwards, returns full sell signal. +/// When `main value` crosses zero line upwards, returns full buy signal. +/// When `main value` crosses zero line downwards, returns full sell signal. #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct EaseOfMovement { diff --git a/src/indicators/elders_force_index.rs b/src/indicators/elders_force_index.rs index f83ae0c..b6ad807 100644 --- a/src/indicators/elders_force_index.rs +++ b/src/indicators/elders_force_index.rs @@ -23,8 +23,8 @@ use crate::methods::Cross; /// # 1 signal /// /// * Signal 1 appears when `main value` crosses zero line. -/// When `main value` crosses zero line upwards, returns full buy signal. -/// When `main value` crosses zero line downwards, returns full sell signal. +/// When `main value` crosses zero line upwards, returns full buy signal. +/// When `main value` crosses zero line downwards, returns full sell signal. #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct EldersForceIndex { diff --git a/src/indicators/envelopes.rs b/src/indicators/envelopes.rs index 696e246..137cd45 100644 --- a/src/indicators/envelopes.rs +++ b/src/indicators/envelopes.rs @@ -26,8 +26,8 @@ use crate::helpers::MA; /// # 1 signal /// /// * Signal 1 appears when `Source2` value crosses bounds. -/// When `Source2` value crosses `upper bound` upwards, returns full sell signal. -/// When `Source2` value crosses `lower bound` downwards, returns full buy signal. +/// When `Source2` value crosses `upper bound` upwards, returns full sell signal. +/// When `Source2` value crosses `lower bound` downwards, returns full buy signal. #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Envelopes { diff --git a/src/indicators/fisher_transform.rs b/src/indicators/fisher_transform.rs index 4f3bd81..9886346 100644 --- a/src/indicators/fisher_transform.rs +++ b/src/indicators/fisher_transform.rs @@ -29,7 +29,7 @@ use crate::methods::{Cross, Highest, Lowest}; /// # 2 signals /// /// * Signal 1 appears when `main value` crosses zero line. -/// When `main value` changes direction, returns signal corresponds to relative position of `main value` in `zone` +/// When `main value` changes direction, returns signal corresponds to relative position of `main value` in `zone` /// * Signal 2 appears when `main value` crosses `signal line` and after signal 1 appears #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] diff --git a/src/indicators/hull_moving_average.rs b/src/indicators/hull_moving_average.rs index a85b8cb..a96a295 100644 --- a/src/indicators/hull_moving_average.rs +++ b/src/indicators/hull_moving_average.rs @@ -20,8 +20,8 @@ use crate::methods::{ReversalSignal, HMA}; /// # 1 signal /// /// * When `HMA value` reverses upwards, gives full positive signal. -/// When `HMA value` reverses downwards, gives full negative signal. -/// Otherwise returns no signal. +/// When `HMA value` reverses downwards, gives full negative signal. +/// Otherwise returns no signal. #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct HullMovingAverage { diff --git a/src/indicators/ichimoku_cloud.rs b/src/indicators/ichimoku_cloud.rs index 233a748..a02ee7b 100644 --- a/src/indicators/ichimoku_cloud.rs +++ b/src/indicators/ichimoku_cloud.rs @@ -23,14 +23,14 @@ use crate::methods::{Cross, Highest, Lowest}; /// # 2 signals /// /// * When `Tenkan Sen` crosses `Kijun Sen` upwards and `source` value is greater than both `Senkou Span A and B` and when `Senkou Span A` is greater than `Senkou Span B`, -/// returns full buy signal. -/// When `Tenkan Sen` crosses `Kijun Sen` downwards and `source` value is lower than both `Senkou Span A and B` and when `Senkou Span A` is lower than `Senkou Span B`, -/// returns full sell signal. +/// returns full buy signal. +/// When `Tenkan Sen` crosses `Kijun Sen` downwards and `source` value is lower than both `Senkou Span A and B` and when `Senkou Span A` is lower than `Senkou Span B`, +/// returns full sell signal. /// /// * When `source` value crosses `Kijun Sen` upwards and `source` value is greater than both `Senkou Span A and B` and when `Senkou Span A` is greater than `Senkou Span B`, -/// returns full buy signal. -/// When `source` value crosses `Kijun Sen` downwards and `source` value is lower than both `Senkou Span A and B` and when `Senkou Span A` is lower than `Senkou Span B`, -/// returns full sell signal. +/// returns full buy signal. +/// When `source` value crosses `Kijun Sen` downwards and `source` value is lower than both `Senkou Span A and B` and when `Senkou Span A` is lower than `Senkou Span B`, +/// returns full sell signal. #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct IchimokuCloud { diff --git a/src/indicators/kaufman.rs b/src/indicators/kaufman.rs index 2261a70..9c4fd16 100644 --- a/src/indicators/kaufman.rs +++ b/src/indicators/kaufman.rs @@ -21,9 +21,9 @@ use crate::methods::{Change, Cross, LinearVolatility, StDev}; /// # 1 signal /// /// * if `filter_period` is less or equal than `0`, then returns signal when `KAMA` crosses `source` value. -/// When `source` crosses `KAMA` upwards, returns full buy signal. -/// When `source` crosses `KAMA` downwards, returns full sell signal. -/// Otherwise returns no signal. +/// When `source` crosses `KAMA` upwards, returns full buy signal. +/// When `source` crosses `KAMA` downwards, returns full sell signal. +/// Otherwise returns no signal. /// /// * if `filter_period` is greater than `1`, it uses same cross between `source` and `KAMA`, but with additional filtering using standard deviation. #[derive(Debug, Clone, Copy)] diff --git a/src/indicators/klinger_volume_oscillator.rs b/src/indicators/klinger_volume_oscillator.rs index fd707ff..653d8b9 100644 --- a/src/indicators/klinger_volume_oscillator.rs +++ b/src/indicators/klinger_volume_oscillator.rs @@ -26,12 +26,12 @@ use crate::methods::Cross; /// # 2 signals /// /// * When `main` value crosses `0.0` upwards, then returns full buy signal. -/// When `main` value crosses `0.0` downwards, then returns full sell signal. -/// Otherwise returns no signal. +/// When `main` value crosses `0.0` downwards, then returns full sell signal. +/// Otherwise returns no signal. /// /// * When `main` value crosses `signal line` value upwards, then returns full buy signal. -/// When `main` value crosses `signal line` downwards, then returns full sell signal. -/// Otherwise returns no signal. +/// When `main` value crosses `signal line` downwards, then returns full sell signal. +/// Otherwise returns no signal. #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct KlingerVolumeOscillator { diff --git a/src/indicators/know_sure_thing.rs b/src/indicators/know_sure_thing.rs index b32118b..91bc994 100644 --- a/src/indicators/know_sure_thing.rs +++ b/src/indicators/know_sure_thing.rs @@ -25,8 +25,8 @@ use crate::methods::{Cross, RateOfChange}; /// # 1 signal /// /// * When `KST` crosses `Signal line` upwards, returns full buy signal. -/// When `KST` crosses `Signal line` downwards, returns full sell signal. -/// Otherwise returns no signal. +/// When `KST` crosses `Signal line` downwards, returns full sell signal. +/// Otherwise returns no signal. #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct KnowSureThing { diff --git a/src/indicators/macd.rs b/src/indicators/macd.rs index 503665d..7b580e7 100644 --- a/src/indicators/macd.rs +++ b/src/indicators/macd.rs @@ -25,12 +25,12 @@ use crate::methods::Cross; /// # 2 signal /// /// * When `MACD` crosses `Signal line` upwards, returns full buy signal. -/// When `MACD` crosses `Signal line` downwards, returns full sell signal. -/// Otherwise returns no signal. +/// When `MACD` crosses `Signal line` downwards, returns full sell signal. +/// Otherwise returns no signal. /// /// * When `MACD` crosses zero line upwards, returns full buy signal. -/// When `MACD` crosses zero line downwards, returns full sell signal. -/// Otherwise returns no signal. +/// When `MACD` crosses zero line downwards, returns full sell signal. +/// Otherwise returns no signal. /// #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] diff --git a/src/indicators/momentum_index.rs b/src/indicators/momentum_index.rs index d24d788..7573884 100644 --- a/src/indicators/momentum_index.rs +++ b/src/indicators/momentum_index.rs @@ -20,8 +20,8 @@ use crate::methods::Momentum; /// # 1 signal /// /// * When both momentums are positive, returns full buy signal. -/// When both momentums are negative, returns full sell signal. -/// Otherwise returns no signal. +/// When both momentums are negative, returns full sell signal. +/// Otherwise returns no signal. #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct MomentumIndex { diff --git a/src/indicators/money_flow_index.rs b/src/indicators/money_flow_index.rs index 3ab176d..2cd8a12 100644 --- a/src/indicators/money_flow_index.rs +++ b/src/indicators/money_flow_index.rs @@ -29,12 +29,12 @@ use crate::methods::Cross; /// # 2 signals /// /// * When `MFI` value crosses `lower bound` downwards, returns full buy signal. -/// When `MFI` value crosses `upper bound` upwards, returns full sell signal. -/// Otherwise returns no signal. +/// When `MFI` value crosses `upper bound` upwards, returns full sell signal. +/// Otherwise returns no signal. /// /// * When `MFI` value crosses `lower bound` upwards, returns full buy signal. -/// When `MFI` value crosses `upper bound` downwards, returns full sell signal. -/// Otherwise returns no signal. +/// When `MFI` value crosses `upper bound` downwards, returns full sell signal. +/// Otherwise returns no signal. #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct MoneyFlowIndex { diff --git a/src/indicators/parabolic_sar.rs b/src/indicators/parabolic_sar.rs index 04f0428..1c38245 100644 --- a/src/indicators/parabolic_sar.rs +++ b/src/indicators/parabolic_sar.rs @@ -25,8 +25,8 @@ use super::HLC; /// /// # 1 signal /// * When `trend` changes it's value to positive, then returns full buy signal. -/// When `trend` changes it's value to negative, then returns full sell signal. -/// Otherwise returns no signal. +/// When `trend` changes it's value to negative, then returns full sell signal. +/// Otherwise returns no signal. #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct ParabolicSAR { diff --git a/src/indicators/trend_strength_index.rs b/src/indicators/trend_strength_index.rs index b44dd84..da5fbe0 100644 --- a/src/indicators/trend_strength_index.rs +++ b/src/indicators/trend_strength_index.rs @@ -21,10 +21,10 @@ use crate::methods::{CrossAbove, CrossUnder, ReversalSignal, WMA}; /// # 2 signals /// /// * When `main value` crosses upper `zone` downwards, gives full negative #1 signal. -/// When `main value` crosses lower `zone` upwards, gives full positive #1 signal. +/// When `main value` crosses lower `zone` upwards, gives full positive #1 signal. /// /// * When `main value` is below lower `zone` and changes direction upwards, gives full positive #2 signal -/// When `main value` is above upper `zone` and changes direction downwards, gives full negative #2 signal +/// When `main value` is above upper `zone` and changes direction downwards, gives full negative #2 signal #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct TrendStrengthIndex { diff --git a/src/indicators/trix.rs b/src/indicators/trix.rs index 3ef8527..a09e695 100644 --- a/src/indicators/trix.rs +++ b/src/indicators/trix.rs @@ -27,16 +27,16 @@ use serde::{Deserialize, Serialize}; /// # 3 signals /// /// * When `main` value changes direction upwards, returns full buy signal. -/// When `main` value changes direction downwards, returns full sell signal. -/// Otherwise returns no signal. +/// When `main` value changes direction downwards, returns full sell signal. +/// Otherwise returns no signal. /// /// * When `main` value crosses `signal line` value upwards, returns full buy signal. -/// When `main` value crosses `signal line` value downwards, returns full sell signal. -/// Otherwise returns no signal. +/// When `main` value crosses `signal line` value downwards, returns full sell signal. +/// Otherwise returns no signal. /// /// * When `main` value crosses zero line upwards, returns full buy signal. -/// When `main` value crosses zero line downwards, returns full sell signal. -/// Otherwise returns no signal. +/// When `main` value crosses zero line downwards, returns full sell signal. +/// Otherwise returns no signal. #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Trix { diff --git a/src/indicators/true_strength_index.rs b/src/indicators/true_strength_index.rs index 0b754ea..02f8302 100644 --- a/src/indicators/true_strength_index.rs +++ b/src/indicators/true_strength_index.rs @@ -30,14 +30,14 @@ use crate::methods::{Cross, CrossAbove, CrossUnder, EMA, TSI}; /// Otherwise returns no signal. /// /// * Signal #2. -/// When `main` value crosses zero line upwards, returns full buy signal. -/// When `main` value crosses zero line downwards, returns full sell signal. -/// Otherwise returns no signal. +/// When `main` value crosses zero line upwards, returns full buy signal. +/// When `main` value crosses zero line downwards, returns full sell signal. +/// Otherwise returns no signal. /// /// * Signal #3. -/// When `main` value crosses `signal line` upwards, returns full buy signal. -/// When `main` value crosses `signal line` downwards, returns full sell signal. -/// Otherwise returns no signal. +/// When `main` value crosses `signal line` upwards, returns full buy signal. +/// When `main` value crosses `signal line` downwards, returns full sell signal. +/// Otherwise returns no signal. #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct TrueStrengthIndex { diff --git a/src/indicators/woodies_cci.rs b/src/indicators/woodies_cci.rs index 000f9a8..450fe00 100644 --- a/src/indicators/woodies_cci.rs +++ b/src/indicators/woodies_cci.rs @@ -28,8 +28,8 @@ const SCALE: ValueType = 1.0 / 1.5; /// # 1 signals /// /// * When `Trend CCI` stays above zero line for `s1_lag` bars, returns full buy signal. -/// When `Trend CCI` stays below zero line for `s1_lag` bars, returns full sell signal. -/// Otherwise returns no signal. +/// When `Trend CCI` stays below zero line for `s1_lag` bars, returns full sell signal. +/// Otherwise returns no signal. #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct WoodiesCCI { diff --git a/src/lib.rs b/src/lib.rs index 078f4bf..2935175 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -51,7 +51,7 @@ limitations under the License. //! - [Simple moving average (SMA)](crate::methods::SMA); //! - [Weighted moving average (WMA)](crate::methods::WMA); //! - Exponential moving average family: [EMA](crate::methods::EMA), [DMA](crate::methods::DMA), [TMA](crate::methods::TMA), -//! [DEMA](crate::methods::DEMA), [TEMA](crate::methods::TEMA); +//! [DEMA](crate::methods::DEMA), [TEMA](crate::methods::TEMA); //! - [Simple moving median (SMM)](crate::methods::SMM); //! - [Linear regression moving average (LSMA)](crate::methods::LinReg); //! - [Volume weighted moving average (VWMA)](crate::methods::VWMA);