Skip to content

Commit 5eabd91

Browse files
committed
rollup merge of #19873: drewm1980/master
In US english, "that" is used in restrictive clauses in place of "which", and often affects the meaning of sentences. In UK english and many dialects, no distinction is made. While Rust devs want to avoid unproductive pedanticism, it is worth at least being uniform in documentation such as: http://doc.rust-lang.org/std/iter/index.html and also in cases where correct usage of US english clarifies the sentence.
2 parents 8ef4120 + 8fcc832 commit 5eabd91

File tree

6 files changed

+41
-41
lines changed

6 files changed

+41
-41
lines changed

src/doc/guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4439,7 +4439,7 @@ for i in range(0u, nums.len()) {
44394439
```
44404440
44414441
This is strictly worse than using an actual iterator. The `.iter()` method on
4442-
vectors returns an iterator which iterates through a reference to each element
4442+
vectors returns an iterator that iterates through a reference to each element
44434443
of the vector in turn. So write this:
44444444
44454445
```{rust}

src/libcollections/ring_buf.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ impl<T> RingBuf<T> {
377377
}
378378
}
379379

380-
/// Returns a front-to-back iterator which returns mutable references.
380+
/// Returns a front-to-back iterator that returns mutable references.
381381
///
382382
/// # Examples
383383
///

src/libcore/iter.rs

+26-26
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ pub trait Iterator<A> {
110110
#[unstable = "new convention for extension traits"]
111111
/// An extension trait providing numerous methods applicable to all iterators.
112112
pub trait IteratorExt<A>: Iterator<A> {
113-
/// Chain this iterator with another, returning a new iterator which will
114-
/// finish iterating over the current iterator, and then it will iterate
113+
/// Chain this iterator with another, returning a new iterator that will
114+
/// finish iterating over the current iterator, and then iterate
115115
/// over the other specified iterator.
116116
///
117117
/// # Example
@@ -130,7 +130,7 @@ pub trait IteratorExt<A>: Iterator<A> {
130130
Chain{a: self, b: other, flag: false}
131131
}
132132

133-
/// Creates an iterator which iterates over both this and the specified
133+
/// Creates an iterator that iterates over both this and the specified
134134
/// iterators simultaneously, yielding the two elements as pairs. When
135135
/// either iterator returns None, all further invocations of next() will
136136
/// return None.
@@ -151,7 +151,7 @@ pub trait IteratorExt<A>: Iterator<A> {
151151
Zip{a: self, b: other}
152152
}
153153

154-
/// Creates a new iterator which will apply the specified function to each
154+
/// Creates a new iterator that will apply the specified function to each
155155
/// element returned by the first, yielding the mapped element instead.
156156
///
157157
/// # Example
@@ -169,8 +169,8 @@ pub trait IteratorExt<A>: Iterator<A> {
169169
Map{iter: self, f: f}
170170
}
171171

172-
/// Creates an iterator which applies the predicate to each element returned
173-
/// by this iterator. Only elements which have the predicate evaluate to
172+
/// Creates an iterator that applies the predicate to each element returned
173+
/// by this iterator. Only elements that have the predicate evaluate to
174174
/// `true` will be yielded.
175175
///
176176
/// # Example
@@ -187,7 +187,7 @@ pub trait IteratorExt<A>: Iterator<A> {
187187
Filter{iter: self, predicate: predicate}
188188
}
189189

190-
/// Creates an iterator which both filters and maps elements.
190+
/// Creates an iterator that both filters and maps elements.
191191
/// If the specified function returns None, the element is skipped.
192192
/// Otherwise the option is unwrapped and the new value is yielded.
193193
///
@@ -205,7 +205,7 @@ pub trait IteratorExt<A>: Iterator<A> {
205205
FilterMap { iter: self, f: f }
206206
}
207207

208-
/// Creates an iterator which yields a pair of the value returned by this
208+
/// Creates an iterator that yields a pair of the value returned by this
209209
/// iterator plus the current index of iteration.
210210
///
211211
/// # Example
@@ -248,7 +248,7 @@ pub trait IteratorExt<A>: Iterator<A> {
248248
Peekable{iter: self, peeked: None}
249249
}
250250

251-
/// Creates an iterator which invokes the predicate on elements until it
251+
/// Creates an iterator that invokes the predicate on elements until it
252252
/// returns false. Once the predicate returns false, all further elements are
253253
/// yielded.
254254
///
@@ -268,7 +268,7 @@ pub trait IteratorExt<A>: Iterator<A> {
268268
SkipWhile{iter: self, flag: false, predicate: predicate}
269269
}
270270

271-
/// Creates an iterator which yields elements so long as the predicate
271+
/// Creates an iterator that yields elements so long as the predicate
272272
/// returns true. After the predicate returns false for the first time, no
273273
/// further elements will be yielded.
274274
///
@@ -287,8 +287,8 @@ pub trait IteratorExt<A>: Iterator<A> {
287287
TakeWhile{iter: self, flag: false, predicate: predicate}
288288
}
289289

290-
/// Creates an iterator which skips the first `n` elements of this iterator,
291-
/// and then it yields all further items.
290+
/// Creates an iterator that skips the first `n` elements of this iterator,
291+
/// and then yields all further items.
292292
///
293293
/// # Example
294294
///
@@ -305,8 +305,8 @@ pub trait IteratorExt<A>: Iterator<A> {
305305
Skip{iter: self, n: n}
306306
}
307307

308-
/// Creates an iterator which yields the first `n` elements of this
309-
/// iterator, and then it will always return None.
308+
/// Creates an iterator that yields the first `n` elements of this
309+
/// iterator, and then will always return None.
310310
///
311311
/// # Example
312312
///
@@ -324,7 +324,7 @@ pub trait IteratorExt<A>: Iterator<A> {
324324
Take{iter: self, n: n}
325325
}
326326

327-
/// Creates a new iterator which behaves in a similar fashion to fold.
327+
/// Creates a new iterator that behaves in a similar fashion to fold.
328328
/// There is a state which is passed between each iteration and can be
329329
/// mutated as necessary. The yielded values from the closure are yielded
330330
/// from the Scan instance when not None.
@@ -1223,7 +1223,7 @@ impl<A, T: Clone + RandomAccessIterator<A>> RandomAccessIterator<A> for Cycle<T>
12231223
}
12241224
}
12251225

1226-
/// An iterator which strings two iterators together
1226+
/// An iterator that strings two iterators together
12271227
#[deriving(Clone)]
12281228
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
12291229
#[stable]
@@ -1297,7 +1297,7 @@ for Chain<T, U> {
12971297
}
12981298
}
12991299

1300-
/// An iterator which iterates two other iterators simultaneously
1300+
/// An iterator that iterates two other iterators simultaneously
13011301
#[deriving(Clone)]
13021302
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
13031303
#[stable]
@@ -1380,7 +1380,7 @@ RandomAccessIterator<(A, B)> for Zip<T, U> {
13801380
}
13811381
}
13821382

1383-
/// An iterator which maps the values of `iter` with `f`
1383+
/// An iterator that maps the values of `iter` with `f`
13841384
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
13851385
#[stable]
13861386
pub struct Map<A, B, I: Iterator<A>, F: FnMut(A) -> B> {
@@ -1441,7 +1441,7 @@ impl<A, B, I, F> RandomAccessIterator<B> for Map<A, B, I, F> where
14411441
}
14421442
}
14431443

1444-
/// An iterator which filters the elements of `iter` with `predicate`
1444+
/// An iterator that filters the elements of `iter` with `predicate`
14451445
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
14461446
#[stable]
14471447
pub struct Filter<A, I, P> where I: Iterator<A>, P: FnMut(&A) -> bool {
@@ -1486,7 +1486,7 @@ impl<A, I, P> DoubleEndedIterator<A> for Filter<A, I, P> where
14861486
}
14871487
}
14881488

1489-
/// An iterator which uses `f` to both filter and map elements from `iter`
1489+
/// An iterator that uses `f` to both filter and map elements from `iter`
14901490
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
14911491
#[stable]
14921492
pub struct FilterMap<A, B, I, F> where I: Iterator<A>, F: FnMut(A) -> Option<B> {
@@ -1534,7 +1534,7 @@ impl<A, B, I, F> DoubleEndedIterator<B> for FilterMap<A, B, I, F> where
15341534
}
15351535
}
15361536

1537-
/// An iterator which yields the current count and the element during iteration
1537+
/// An iterator that yields the current count and the element during iteration
15381538
#[deriving(Clone)]
15391539
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
15401540
#[stable]
@@ -1648,7 +1648,7 @@ impl<'a, A, T: Iterator<A>> Peekable<A, T> {
16481648
}
16491649
}
16501650

1651-
/// An iterator which rejects elements while `predicate` is true
1651+
/// An iterator that rejects elements while `predicate` is true
16521652
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
16531653
#[stable]
16541654
pub struct SkipWhile<A, I, P> where I: Iterator<A>, P: FnMut(&A) -> bool {
@@ -1677,7 +1677,7 @@ impl<A, I, P> Iterator<A> for SkipWhile<A, I, P> where I: Iterator<A>, P: FnMut(
16771677
}
16781678
}
16791679

1680-
/// An iterator which only accepts elements while `predicate` is true
1680+
/// An iterator that only accepts elements while `predicate` is true
16811681
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
16821682
#[stable]
16831683
pub struct TakeWhile<A, I, P> where I: Iterator<A>, P: FnMut(&A) -> bool {
@@ -1714,7 +1714,7 @@ impl<A, I, P> Iterator<A> for TakeWhile<A, I, P> where I: Iterator<A>, P: FnMut(
17141714
}
17151715
}
17161716

1717-
/// An iterator which skips over `n` elements of `iter`.
1717+
/// An iterator that skips over `n` elements of `iter`.
17181718
#[deriving(Clone)]
17191719
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
17201720
#[stable]
@@ -1782,7 +1782,7 @@ impl<A, T: RandomAccessIterator<A>> RandomAccessIterator<A> for Skip<T> {
17821782
}
17831783
}
17841784

1785-
/// An iterator which only iterates over the first `n` iterations of `iter`.
1785+
/// An iterator that only iterates over the first `n` iterations of `iter`.
17861786
#[deriving(Clone)]
17871787
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
17881788
#[stable]
@@ -2075,7 +2075,7 @@ impl<A, I, F> RandomAccessIterator<A> for Inspect<A, I, F> where
20752075
}
20762076
}
20772077

2078-
/// An iterator which passes mutable state to a closure and yields the result.
2078+
/// An iterator that passes mutable state to a closure and yields the result.
20792079
///
20802080
/// # Example: The Fibonacci Sequence
20812081
///

src/librand/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -185,7 +185,7 @@ pub trait Rng {
185185
Rand::rand(self)
186186
}
187187

188-
/// Return an iterator which will yield an infinite number of randomly
188+
/// Return an iterator that will yield an infinite number of randomly
189189
/// generated items.
190190
///
191191
/// # Example

src/libstd/comm/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
//! Shared usage:
8282
//!
8383
//! ```
84-
//! // Create a shared channel which can be sent along from many tasks
84+
//! // Create a shared channel that can be sent along from many tasks
8585
//! // where tx is the sending half (tx for transmission), and rx is the receiving
8686
//! // half (rx for receiving).
8787
//! let (tx, rx) = channel();
@@ -176,7 +176,7 @@
176176
// The choice of implementation of all channels is to be built on lock-free data
177177
// structures. The channels themselves are then consequently also lock-free data
178178
// structures. As always with lock-free code, this is a very "here be dragons"
179-
// territory, especially because I'm unaware of any academic papers which have
179+
// territory, especially because I'm unaware of any academic papers that have
180180
// gone into great length about channels of these flavors.
181181
//
182182
// ## Flavors of channels
@@ -190,7 +190,7 @@
190190
// They contain as few atomics as possible and involve one and
191191
// exactly one allocation.
192192
// * Streams - these channels are optimized for the non-shared use case. They
193-
// use a different concurrent queue which is more tailored for this
193+
// use a different concurrent queue that is more tailored for this
194194
// use case. The initial allocation of this flavor of channel is not
195195
// optimized.
196196
// * Shared - this is the most general form of channel that this module offers,
@@ -205,7 +205,7 @@
205205
// shared and concurrent queue holding all of the actual data.
206206
//
207207
// With two flavors of channels, two flavors of queues are also used. We have
208-
// chosen to use queues from a well-known author which are abbreviated as SPSC
208+
// chosen to use queues from a well-known author that are abbreviated as SPSC
209209
// and MPSC (single producer, single consumer and multiple producer, single
210210
// consumer). SPSC queues are used for streams while MPSC queues are used for
211211
// shared channels.
@@ -309,7 +309,7 @@
309309
//
310310
// Sadly this current implementation requires multiple allocations, so I have
311311
// seen the throughput of select() be much worse than it should be. I do not
312-
// believe that there is anything fundamental which needs to change about these
312+
// believe that there is anything fundamental that needs to change about these
313313
// channels, however, in order to support a more efficient select().
314314
//
315315
// # Conclusion
@@ -910,7 +910,7 @@ impl<T: Send> Receiver<T> {
910910
}
911911
}
912912

913-
/// Returns an iterator which will block waiting for messages, but never
913+
/// Returns an iterator that will block waiting for messages, but never
914914
/// `panic!`. It will return `None` when the channel has hung up.
915915
#[unstable]
916916
pub fn iter<'a>(&'a self) -> Messages<'a, T> {

src/libstd/io/fs.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl File {
200200
.update_desc("couldn't create file")
201201
}
202202

203-
/// Returns the original path which was used to open this file.
203+
/// Returns the original path that was used to open this file.
204204
pub fn path<'a>(&'a self) -> &'a Path {
205205
&self.path
206206
}
@@ -215,7 +215,7 @@ impl File {
215215
}
216216

217217
/// This function is similar to `fsync`, except that it may not synchronize
218-
/// file metadata to the filesystem. This is intended for use case which
218+
/// file metadata to the filesystem. This is intended for use cases that
219219
/// must synchronize content, but don't need the metadata on disk. The goal
220220
/// of this method is to reduce disk operations.
221221
pub fn datasync(&mut self) -> IoResult<()> {
@@ -456,7 +456,7 @@ pub fn symlink(src: &Path, dst: &Path) -> IoResult<()> {
456456
/// # Error
457457
///
458458
/// This function will return an error on failure. Failure conditions include
459-
/// reading a file that does not exist or reading a file which is not a symlink.
459+
/// reading a file that does not exist or reading a file that is not a symlink.
460460
pub fn readlink(path: &Path) -> IoResult<Path> {
461461
fs_imp::readlink(path)
462462
.update_err("couldn't resolve symlink for path", |e|
@@ -546,7 +546,7 @@ pub fn readdir(path: &Path) -> IoResult<Vec<Path>> {
546546
|e| format!("{}; path={}", e, path.display()))
547547
}
548548

549-
/// Returns an iterator which will recursively walk the directory structure
549+
/// Returns an iterator that will recursively walk the directory structure
550550
/// rooted at `path`. The path given will not be iterated over, and this will
551551
/// perform iteration in some top-down order. The contents of unreadable
552552
/// subdirectories are ignored.
@@ -557,7 +557,7 @@ pub fn walk_dir(path: &Path) -> IoResult<Directories> {
557557
})
558558
}
559559

560-
/// An iterator which walks over a directory
560+
/// An iterator that walks over a directory
561561
pub struct Directories {
562562
stack: Vec<Path>,
563563
}

0 commit comments

Comments
 (0)