|
|
|
@ -33,6 +33,23 @@ pub struct SliceMeta<T = AnySlice>
|
|
|
|
|
_slice: PhantomData<[T]>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl<T, U: ?Sized> PartialEq<U> for SliceMeta<T>
|
|
|
|
|
where U: AsRef<[T]>
|
|
|
|
|
{
|
|
|
|
|
#[inline] fn eq(&self, other: &U) -> bool
|
|
|
|
|
{
|
|
|
|
|
SliceMeta::from_slice_any(other.as_ref()) == self.as_any()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl<T, U: AsRef<[T]>> From<U> for SliceMeta<T>
|
|
|
|
|
{
|
|
|
|
|
fn from(from: U) -> Self
|
|
|
|
|
{
|
|
|
|
|
Self::from_slice(from.as_ref())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl SliceMeta<AnySlice>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|