docs: Replace std::iterator with std::iter.

This commit is contained in:
Huon Wilson
2013-11-04 10:01:00 +11:00
parent 702767db65
commit da43676e39
4 changed files with 13 additions and 14 deletions

View File

@@ -2750,9 +2750,8 @@ do k(3) |j| {
for_expr : "for" pat "in" expr '{' block '}' ; for_expr : "for" pat "in" expr '{' block '}' ;
~~~~ ~~~~
A `for` expression is a syntactic construct for looping A `for` expression is a syntactic construct for looping over elements
over elements provided by an implementation of provided by an implementation of `std::iter::Iterator`.
`std::iterator::Iterator`.
An example of a for loop over the contents of a vector: An example of a for loop over the contents of a vector:

View File

@@ -69,7 +69,7 @@ heapsort.
## Iteration protocol ## Iteration protocol
The iteration protocol is defined by the `Iterator` trait in the The iteration protocol is defined by the `Iterator` trait in the
`std::iterator` module. The minimal implementation of the trait is a `next` `std::iter` module. The minimal implementation of the trait is a `next`
method, yielding the next element from an iterator object: method, yielding the next element from an iterator object:
~~~ ~~~

View File

@@ -330,7 +330,7 @@ fn check_for_null(v: &[u8], buf: *mut libc::c_char) {
/// External iterator for a CString's bytes. /// External iterator for a CString's bytes.
/// ///
/// Use with the `std::iterator` module. /// Use with the `std::iter` module.
pub struct CStringIterator<'self> { pub struct CStringIterator<'self> {
priv ptr: *libc::c_char, priv ptr: *libc::c_char,
priv lifetime: &'self libc::c_char, // FIXME: #5922 priv lifetime: &'self libc::c_char, // FIXME: #5922

View File

@@ -352,7 +352,7 @@ Section: Iterators
*/ */
/// External iterator for a string's characters. /// External iterator for a string's characters.
/// Use with the `std::iterator` module. /// Use with the `std::iter` module.
#[deriving(Clone)] #[deriving(Clone)]
pub struct CharIterator<'self> { pub struct CharIterator<'self> {
/// The slice remaining to be iterated /// The slice remaining to be iterated
@@ -397,7 +397,7 @@ impl<'self> DoubleEndedIterator<char> for CharIterator<'self> {
} }
/// External iterator for a string's characters and their byte offsets. /// External iterator for a string's characters and their byte offsets.
/// Use with the `std::iterator` module. /// Use with the `std::iter` module.
#[deriving(Clone)] #[deriving(Clone)]
pub struct CharOffsetIterator<'self> { pub struct CharOffsetIterator<'self> {
/// The original string to be iterated /// The original string to be iterated
@@ -439,20 +439,20 @@ impl<'self> DoubleEndedIterator<(uint, char)> for CharOffsetIterator<'self> {
} }
/// External iterator for a string's characters in reverse order. /// External iterator for a string's characters in reverse order.
/// Use with the `std::iterator` module. /// Use with the `std::iter` module.
pub type CharRevIterator<'self> = Invert<CharIterator<'self>>; pub type CharRevIterator<'self> = Invert<CharIterator<'self>>;
/// External iterator for a string's characters and their byte offsets in reverse order. /// External iterator for a string's characters and their byte offsets in reverse order.
/// Use with the `std::iterator` module. /// Use with the `std::iter` module.
pub type CharOffsetRevIterator<'self> = Invert<CharOffsetIterator<'self>>; pub type CharOffsetRevIterator<'self> = Invert<CharOffsetIterator<'self>>;
/// External iterator for a string's bytes. /// External iterator for a string's bytes.
/// Use with the `std::iterator` module. /// Use with the `std::iter` module.
pub type ByteIterator<'self> = pub type ByteIterator<'self> =
Map<'self, &'self u8, u8, vec::VecIterator<'self, u8>>; Map<'self, &'self u8, u8, vec::VecIterator<'self, u8>>;
/// External iterator for a string's bytes in reverse order. /// External iterator for a string's bytes in reverse order.
/// Use with the `std::iterator` module. /// Use with the `std::iter` module.
pub type ByteRevIterator<'self> = Invert<ByteIterator<'self>>; pub type ByteRevIterator<'self> = Invert<ByteIterator<'self>>;
/// An iterator over the substrings of a string, separated by `sep`. /// An iterator over the substrings of a string, separated by `sep`.
@@ -682,7 +682,7 @@ enum NormalizationForm {
} }
/// External iterator for a string's normalization's characters. /// External iterator for a string's normalization's characters.
/// Use with the `std::iterator` module. /// Use with the `std::iter` module.
#[deriving(Clone)] #[deriving(Clone)]
struct NormalizationIterator<'self> { struct NormalizationIterator<'self> {
priv kind: NormalizationForm, priv kind: NormalizationForm,