Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions doc/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -2063,7 +2063,7 @@ The currently implemented features of the compiler are:

* `once_fns` - Onceness guarantees a closure is only executed once. Defining a
closure as `once` is unlikely to be supported going forward. So
they are hidden behind this feature until they are to be removed.
they are hidden behind this feature until they are to be removed.

If a feature is promoted to a language feature, then all existing programs will
start to receive compilation warnings about #[feature] directives which enabled
Expand Down Expand Up @@ -2748,11 +2748,10 @@ do k(3) |j| {

~~~~ {.ebnf .gram}
for_expr : "for" pat "in" expr '{' block '}' ;
~~~~
~~~~

A `for` expression is a syntactic construct for looping
over elements provided by an implementation of
`std::iterator::Iterator`.
A `for` expression is a syntactic construct for looping over elements
provided by an implementation of `std::iter::Iterator`.

An example of a for loop over the contents of a vector:

Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial-container.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ heapsort.
## Iteration protocol

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:

~~~
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ fn check_for_null(v: &[u8], buf: *mut libc::c_char) {

/// External iterator for a CString's bytes.
///
/// Use with the `std::iterator` module.
/// Use with the `std::iter` module.
pub struct CStringIterator<'self> {
priv ptr: *libc::c_char,
priv lifetime: &'self libc::c_char, // FIXME: #5922
Expand Down
14 changes: 7 additions & 7 deletions src/libstd/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ Section: Iterators
*/

/// External iterator for a string's characters.
/// Use with the `std::iterator` module.
/// Use with the `std::iter` module.
#[deriving(Clone)]
pub struct CharIterator<'self> {
/// The slice remaining to be iterated
Expand Down Expand Up @@ -397,7 +397,7 @@ impl<'self> DoubleEndedIterator<char> for CharIterator<'self> {
}

/// 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)]
pub struct CharOffsetIterator<'self> {
/// The original string to be iterated
Expand Down Expand Up @@ -439,20 +439,20 @@ impl<'self> DoubleEndedIterator<(uint, char)> for CharOffsetIterator<'self> {
}

/// 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>>;

/// 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>>;

/// External iterator for a string's bytes.
/// Use with the `std::iterator` module.
/// Use with the `std::iter` module.
pub type ByteIterator<'self> =
Map<'self, &'self u8, u8, vec::VecIterator<'self, u8>>;

/// 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>>;

/// An iterator over the substrings of a string, separated by `sep`.
Expand Down Expand Up @@ -682,7 +682,7 @@ enum NormalizationForm {
}

/// External iterator for a string's normalization's characters.
/// Use with the `std::iterator` module.
/// Use with the `std::iter` module.
#[deriving(Clone)]
struct NormalizationIterator<'self> {
priv kind: NormalizationForm,
Expand Down