}
impl Hasher for TypeIdHasher {
- #[inline(always)]
+ #[inline]
fn write(&mut self, bytes: &[u8]) {
// This expects to receive one and exactly one 64-bit value
debug_assert!(bytes.len() == 8);
}
}
- #[inline(always)]
+ #[inline]
fn finish(&self) -> u64 { self.value }
}
with_capacity(capacity) => HashMap::with_capacity_and_hasher(capacity, Default::default());
}
-/// RawMap iterator.
+/// `RawMap` iterator.
#[derive(Clone)]
pub struct Iter<'a, A: ?Sized + UncheckedAnyExt> {
inner: hash_map::Iter<'a, TypeId, Box<A>>,
#[inline] fn len(&self) -> usize { self.inner.len() }
}
-/// RawMap mutable iterator.
+/// `RawMap` mutable iterator.
pub struct IterMut<'a, A: ?Sized + UncheckedAnyExt> {
inner: hash_map::IterMut<'a, TypeId, Box<A>>,
}
#[inline] fn len(&self) -> usize { self.inner.len() }
}
-/// RawMap move iterator.
+/// `RawMap` move iterator.
pub struct IntoIter<A: ?Sized + UncheckedAnyExt> {
inner: hash_map::IntoIter<TypeId, Box<A>>,
}
#[inline] fn len(&self) -> usize { self.inner.len() }
}
-/// RawMap drain iterator.
+/// `RawMap` drain iterator.
pub struct Drain<'a, A: ?Sized + UncheckedAnyExt> {
inner: hash_map::Drain<'a, TypeId, Box<A>>,
}
impl<A: ?Sized + UncheckedAnyExt, Q> Index<Q> for RawMap<A> where TypeId: Borrow<Q>, Q: Eq + Hash {
type Output = A;
- fn index<'a>(&'a self, index: Q) -> &'a A {
+ fn index(&self, index: Q) -> &A {
self.get(&index).expect("no entry found for key")
}
}
impl<A: ?Sized + UncheckedAnyExt, Q> IndexMut<Q> for RawMap<A> where TypeId: Borrow<Q>, Q: Eq + Hash {
- fn index_mut<'a>(&'a mut self, index: Q) -> &'a mut A {
+ fn index_mut(&mut self, index: Q) -> &mut A {
self.get_mut(&index).expect("no entry found for key")
}
}