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.data == 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.data
16    }
17}
18impl<T: PartialEq> PartialEq<Fragment<T>> for Vec<T> {
19    fn eq(&self, other: &Fragment<T>) -> bool {
20        self == &other.data
21    }
22}
23impl<T: PartialEq, const N: usize> PartialEq<Fragment<T>> for [T; N] {
24    fn eq(&self, other: &Fragment<T>) -> bool {
25        self.as_slice() == other.data
26    }
27}