From a9f1026804232bd12998e49210b787f253be4dbd Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Mon, 19 Aug 2019 21:12:02 +0300 Subject: [PATCH] Implement PartialEq/Eq for SliceInfo --- src/slice.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/slice.rs b/src/slice.rs index 85abfb8e0..399e8e694 100644 --- a/src/slice.rs +++ b/src/slice.rs @@ -295,6 +295,25 @@ pub struct SliceInfo { indices: T, } +impl PartialEq> for SliceInfo +where + T1: AsRef<[SliceOrIndex]>, + T2: AsRef<[SliceOrIndex]>, + D1: Dimension, + D2: Dimension, +{ + fn eq(&self, other: &SliceInfo) -> bool { + self.indices.as_ref() == other.indices.as_ref() + } +} + +impl Eq for SliceInfo +where + T: AsRef<[SliceOrIndex]>, + D: Dimension, +{ +} + impl Deref for SliceInfo where D: Dimension,