TrustedLen for Empty and Once.
This commit is contained in:
parent
7f2d2afa91
commit
c903210f68
1 changed files with 7 additions and 1 deletions
|
@ -12,7 +12,7 @@ use fmt;
|
|||
use marker;
|
||||
use usize;
|
||||
|
||||
use super::FusedIterator;
|
||||
use super::{FusedIterator, TrustedLen};
|
||||
|
||||
/// An iterator that repeats an element endlessly.
|
||||
///
|
||||
|
@ -138,6 +138,9 @@ impl<T> ExactSizeIterator for Empty<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "trusted_len", issue = "37572")]
|
||||
unsafe impl<T> TrustedLen for Empty<T> {}
|
||||
|
||||
#[unstable(feature = "fused", issue = "35602")]
|
||||
impl<T> FusedIterator for Empty<T> {}
|
||||
|
||||
|
@ -216,6 +219,9 @@ impl<T> ExactSizeIterator for Once<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "trusted_len", issue = "37572")]
|
||||
unsafe impl<T> TrustedLen for Once<T> {}
|
||||
|
||||
#[unstable(feature = "fused", issue = "35602")]
|
||||
impl<T> FusedIterator for Once<T> {}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue