Skip to content

Commit b749f41

Browse files
committed
PartialEq for DataSample and TimeSeries
1 parent a37da25 commit b749f41

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/data/data_sample.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ where
2121
std2: Option<T>,
2222
}
2323

24+
impl<'a, T> PartialEq for DataSample<'a, T>
25+
where
26+
T: Float,
27+
{
28+
fn eq(&self, other: &Self) -> bool {
29+
self.sample == other.sample
30+
}
31+
}
32+
2433
macro_rules! data_sample_getter {
2534
($attr: ident, $getter: ident, $func: expr, $method_sorted: ident) => {
2635
// This lint is false-positive in macros

src/data/time_series.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ where
2828
plateau: Option<bool>,
2929
}
3030

31+
impl<'a, T> PartialEq for TimeSeries<'a, T>
32+
where
33+
T: Float,
34+
{
35+
fn eq(&self, other: &Self) -> bool {
36+
self.t == other.t && self.m == other.m && self.w == other.w
37+
}
38+
}
39+
3140
macro_rules! time_series_getter {
3241
($t: ty, $attr: ident, $getter: ident, $func: expr) => {
3342
// This lint is false-positive in macros

0 commit comments

Comments
 (0)