1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use crate::Fragment;
use alloc::vec::Vec;

impl<T: PartialEq, U> PartialEq<U> for Fragment<T>
where
    U: AsRef<[T]>,
{
    fn eq(&self, other: &U) -> bool {
        self.data == other.as_ref()
    }
}

impl<T: PartialEq> PartialEq<Fragment<T>> for [T] {
    fn eq(&self, other: &Fragment<T>) -> bool {
        self == other.data
    }
}
impl<T: PartialEq> PartialEq<Fragment<T>> for Vec<T> {
    fn eq(&self, other: &Fragment<T>) -> bool {
        self == &other.data
    }
}
impl<T: PartialEq, const N: usize> PartialEq<Fragment<T>> for [T; N] {
    fn eq(&self, other: &Fragment<T>) -> bool {
        self.as_slice() == other.data
    }
}