Add a FusedIterator trait.
This trait can be used to avoid the overhead of a fuse wrapper when an iterator is already well-behaved. Conforming to: RFC 1581 Closes: #35602
This commit is contained in:
@@ -107,7 +107,7 @@ use fmt;
|
||||
use fs;
|
||||
use hash::{Hash, Hasher};
|
||||
use io;
|
||||
use iter;
|
||||
use iter::{self, FusedIterator};
|
||||
use mem;
|
||||
use ops::{self, Deref};
|
||||
use string::String;
|
||||
@@ -858,6 +858,9 @@ impl<'a> DoubleEndedIterator for Iter<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "fused", issue = "35602")]
|
||||
impl<'a> FusedIterator for Iter<'a> {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<'a> Iterator for Components<'a> {
|
||||
type Item = Component<'a>;
|
||||
@@ -958,6 +961,9 @@ impl<'a> DoubleEndedIterator for Components<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "fused", issue = "35602")]
|
||||
impl<'a> FusedIterator for Components<'a> {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<'a> cmp::PartialEq for Components<'a> {
|
||||
fn eq(&self, other: &Components<'a>) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user