Skip to main content

orx_split_vec/fragment/
eq.rs

1use crate::Fragment;
2use alloc::vec::Vec;
3
4impl<T: PartialEq, U> PartialEq<U> for Fragment<T>
5where
6    U: AsRef<[T]>,
7{
8    fn eq(&self, other: &U) -> bool {
9        self.as_slice() == other.as_ref()
10    }
11}
12
13impl<T: PartialEq> PartialEq<Fragment<T>> for [T] {
14    fn eq(&self, other: &Fragment<T>) -> bool {
15        self == other.as_slice()
16    }
17}
18
19impl<T: PartialEq> PartialEq<Fragment<T>> for Vec<T> {
20    fn eq(&self, other: &Fragment<T>) -> bool {
21        self == other.as_slice()
22    }
23}
24
25impl<T: PartialEq, const N: usize> PartialEq<Fragment<T>> for [T; N] {
26    fn eq(&self, other: &Fragment<T>) -> bool {
27        self.as_slice() == other.as_slice()
28    }
29}