mirror of
https://github.com/openharmony/third_party_rust_tinyvec.git
synced 2026-07-21 01:35:22 -04:00
add Hash to ArrayVec and TinyVec
This commit is contained in:
+4
-13
@@ -918,24 +918,15 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
I think, in retrospect, this is useless?
|
||||
|
||||
The `&mut [A::Item]` should coerce to `&[A::Item]` and use the above impl.
|
||||
I'll leave it here for now though since we already had it written out..
|
||||
|
||||
impl<A: Array> PartialEq<&mut [A::Item]> for ArrayVec<A>
|
||||
impl<A: Array> Hash for ArrayVec<A>
|
||||
where
|
||||
A::Item: PartialEq,
|
||||
A::Item: Hash,
|
||||
{
|
||||
#[inline]
|
||||
#[must_use]
|
||||
fn eq(&self, other: &&mut [A::Item]) -> bool {
|
||||
self.deref() == *other
|
||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||
self.as_slice().hash(state)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// //
|
||||
// Formatting impls
|
||||
|
||||
Reference in New Issue
Block a user