From 548ee2a5f27b9de803f9ba48b9b8d71839a9670d Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Sat, 5 Mar 2016 12:58:49 +1100 Subject: [PATCH] Ungate drain iterator (stable in Rust 1.6.0). --- src/raw.rs | 4 ---- 1 file changed, 4 deletions(-) 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(), -- 2.42.0