spinoso_string/enc/utf8/borrowed/
eq.rs

1use alloc::string::String;
2use alloc::vec::Vec;
3
4use bstr::BStr;
5
6use super::Utf8Str;
7
8impl Eq for Utf8Str {}
9
10impl PartialEq<Utf8Str> for Utf8Str {
11    fn eq(&self, other: &Utf8Str) -> bool {
12        self.as_bytes() == other.as_bytes()
13    }
14}
15
16impl<'a> PartialEq<&'a Utf8Str> for Utf8Str {
17    fn eq(&self, other: &&'a Utf8Str) -> bool {
18        self.as_bytes() == other.as_bytes()
19    }
20}
21
22impl_partial_eq!(Utf8Str, Vec<u8>);
23impl_partial_eq!(Utf8Str, &'a Vec<u8>);
24impl_partial_eq!(Utf8Str, [u8]);
25impl_partial_eq!(Utf8Str, &'a [u8]);
26impl_partial_eq!(Utf8Str, &'a mut [u8]);
27impl_partial_eq!(Utf8Str, BStr);
28impl_partial_eq!(Utf8Str, &'a BStr);
29impl_partial_eq!(Utf8Str, &'a mut BStr);
30impl_partial_eq!(Utf8Str, String);
31impl_partial_eq!(Utf8Str, &'a String);
32impl_partial_eq!(Utf8Str, str);
33impl_partial_eq!(Utf8Str, &'a str);
34impl_partial_eq!(Utf8Str, &'a mut str);
35impl_partial_eq_array!(Utf8Str, [u8; N]);
36impl_partial_eq_array!(Utf8Str, &'a [u8; N]);
37impl_partial_eq_array!(Utf8Str, &'a mut [u8; N]);