From: Chris Morgan Date: Sat, 5 Mar 2016 01:58:49 +0000 (+1100) Subject: Ungate drain iterator (stable in Rust 1.6.0). X-Git-Tag: 0.12.0~3 X-Git-Url: https://git.chrismorgan.info/anymap/commitdiff_plain/548ee2a5f27b9de803f9ba48b9b8d71839a9670d Ungate drain iterator (stable in Rust 1.6.0). --- diff --git a/src/raw.rs b/src/raw.rs index 445b137..6aed3e8 100644 --- a/src/raw.rs +++ b/src/raw.rs @@ -106,17 +106,14 @@ impl ExactSizeIterator for IntoIter { } /// RawMap drain iterator. -#[cfg(feature = "unstable")] pub struct Drain<'a, A: ?Sized + UncheckedAnyExt> { inner: hash_map::Drain<'a, TypeId, Box>, } -#[cfg(feature = "unstable")] impl<'a, A: ?Sized + UncheckedAnyExt> Iterator for Drain<'a, A> { type Item = Box; #[inline] fn next(&mut self) -> Option> { self.inner.next().map(|x| x.1) } #[inline] fn size_hint(&self) -> (usize, Option) { self.inner.size_hint() } } -#[cfg(feature = "unstable")] impl<'a, A: ?Sized + UncheckedAnyExt> ExactSizeIterator for Drain<'a, A> { #[inline] fn len(&self) -> usize { self.inner.len() } } @@ -148,7 +145,6 @@ impl RawMap { /// /// Keeps the allocated memory for reuse. #[inline] - #[cfg(feature = "unstable")] pub fn drain(&mut self) -> Drain { Drain { inner: self.inner.drain(),