Skip to content

Commit 5553410

Browse files
committed
std: fix spelling in docs.
1 parent 8f6df87 commit 5553410

File tree

20 files changed

+51
-50
lines changed

20 files changed

+51
-50
lines changed

src/libstd/cell.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl<T> RefCell<T> {
8181

8282
/// Mutably borrows the wrapped value.
8383
///
84-
/// The borrow lasts untile the returned `RefMut` exits scope. The value
84+
/// The borrow lasts until the returned `RefMut` exits scope. The value
8585
/// cannot be borrowed while this borrow is active.
8686
///
8787
/// Returns `None` if the value is currently borrowed.
@@ -98,7 +98,7 @@ impl<T> RefCell<T> {
9898

9999
/// Mutably borrows the wrapped value.
100100
///
101-
/// The borrow lasts untile the returned `RefMut` exits scope. The value
101+
/// The borrow lasts until the returned `RefMut` exits scope. The value
102102
/// cannot be borrowed while this borrow is active.
103103
///
104104
/// # Failure

src/libstd/char.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ fn decompose_hangul(s: char, f: |char|) {
256256
}
257257
}
258258

259-
/// Returns the canonical decompostion of a character
259+
/// Returns the canonical decomposition of a character.
260260
pub fn decompose_canonical(c: char, f: |char|) {
261261
if (c as uint) < S_BASE || (c as uint) >= (S_BASE + S_COUNT) {
262262
decompose::canonical(c, f);
@@ -265,7 +265,7 @@ pub fn decompose_canonical(c: char, f: |char|) {
265265
}
266266
}
267267

268-
/// Returns the compatibility decompostion of a character
268+
/// Returns the compatibility decomposition of a character.
269269
pub fn decompose_compatible(c: char, f: |char|) {
270270
if (c as uint) < S_BASE || (c as uint) >= (S_BASE + S_COUNT) {
271271
decompose::compatibility(c, f);

src/libstd/clone.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub trait Clone {
3333
/// Perform copy-assignment from `source`.
3434
///
3535
/// `a.clone_from(&b)` is equivalent to `a = b.clone()` in functionality,
36-
/// but can be overriden to reuse the resources of `a` to avoid unnecessary
36+
/// but can be overridden to reuse the resources of `a` to avoid unnecessary
3737
/// allocations.
3838
#[inline(always)]
3939
fn clone_from(&mut self, source: &Self) {
@@ -141,7 +141,7 @@ pub trait DeepClone: Clone {
141141
/// Perform deep copy-assignment from `source`.
142142
///
143143
/// `a.deep_clone_from(&b)` is equivalent to `a = b.deep_clone()` in
144-
/// functionality, but can be overriden to reuse the resources of `a` to
144+
/// functionality, but can be overridden to reuse the resources of `a` to
145145
/// avoid unnecessary allocations.
146146
#[inline(always)]
147147
fn deep_clone_from(&mut self, source: &Self) {

src/libstd/condition.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub struct Handler<T, U> {
8181
/// the condition (useful for debugging).
8282
///
8383
/// This struct should never be created directly, but rather only through the
84-
/// `condition!` macro provided to all libraries using libstd.
84+
/// `condition!` macro provided to all libraries using `std`.
8585
pub struct Condition<T, U> {
8686
/// Name of the condition handler
8787
name: &'static str,

src/libstd/fmt/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,9 @@ pub fn writeln(output: &mut io::Writer, args: &Arguments) {
606606
/// See the documentation for `format` for why this function is unsafe and care
607607
/// should be taken if calling it manually.
608608
///
609-
/// Thankfully the rust compiler provides the macro `fmtf!` which will perform
610-
/// all of this validation at compile-time and provides a safe interface for
611-
/// invoking this function.
609+
/// Thankfully the rust compiler provides macros like `write!` and
610+
/// `format_args!` which perform all of this validation at compile-time
611+
/// and provide a safe interface for invoking this function.
612612
///
613613
/// # Arguments
614614
///

src/libstd/io/buffered.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ impl<W: Writer> Decorator<W> for BufferedWriter<W> {
202202
fn inner_mut_ref<'a>(&'a mut self) -> &'a mut W { &mut self.inner }
203203
}
204204

205-
/// Wraps a Writer and buffers output to it, flushing whenever a newline (0xa,
206-
/// '\n') is detected.
205+
/// Wraps a Writer and buffers output to it, flushing whenever a newline (`0x0a`,
206+
/// `'\n'`) is detected.
207207
///
208208
/// Note that this structure does NOT flush the output when dropped.
209209
pub struct LineBufferedWriter<W> {

src/libstd/io/fs.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ pub fn unlink(path: &Path) {
249249
/// directory, etc. This function will traverse symlinks to query
250250
/// information about the destination file.
251251
///
252-
/// Returns a fully-filled out stat structure on succes, and on failure it
252+
/// Returns a fully-filled out stat structure on success, and on failure it
253253
/// will return a dummy stat structure (it is expected that the condition
254254
/// raised is handled as well).
255255
///
@@ -342,7 +342,7 @@ pub fn rename(from: &Path, to: &Path) {
342342
///
343343
/// # Errors
344344
///
345-
/// Will raise an `io_error` condition is the following situtations, but is
345+
/// Will raise an `io_error` condition is the following situations, but is
346346
/// not limited to just these cases:
347347
///
348348
/// * The `from` path is not a file
@@ -391,7 +391,7 @@ pub fn copy(from: &Path, to: &Path) {
391391
///
392392
/// # Errors
393393
///
394-
/// If this funciton encounters an I/O error, it will raise on the `io_error`
394+
/// If this function encounters an I/O error, it will raise on the `io_error`
395395
/// condition. Some possible error situations are not having the permission to
396396
/// change the attributes of a file or the file not existing.
397397
pub fn chmod(path: &Path, mode: io::FilePermission) {
@@ -402,7 +402,7 @@ pub fn chmod(path: &Path, mode: io::FilePermission) {
402402
///
403403
/// # Errors
404404
///
405-
/// This funtion will raise on the `io_error` condition on failure.
405+
/// This function will raise on the `io_error` condition on failure.
406406
pub fn chown(path: &Path, uid: int, gid: int) {
407407
io_raise(|io| io.fs_chown(&path.to_c_str(), uid, gid));
408408
}
@@ -448,7 +448,7 @@ pub fn readlink(path: &Path) -> Option<Path> {
448448
///
449449
/// let p = Path::new("/some/dir");
450450
/// fs::mkdir(&p, S_IRWXU as int);
451-
/// // If we got here, our directory exists! Horray!
451+
/// // If we got here, our directory exists! Hooray!
452452
///
453453
/// # Errors
454454
///
@@ -665,7 +665,7 @@ impl path::Path {
665665
io::result(|| self.stat()).is_ok()
666666
}
667667

668-
/// Whether the underlying implemention (be it a file path, or something
668+
/// Whether the underlying implementation (be it a file path, or something
669669
/// else) points at a "regular file" on the FS. Will return false for paths
670670
/// to non-existent locations or directories or other non-regular files
671671
/// (named pipes, etc).
@@ -680,7 +680,7 @@ impl path::Path {
680680
}
681681
}
682682

683-
/// Whether the underlying implemention (be it a file path,
683+
/// Whether the underlying implementation (be it a file path,
684684
/// or something else) is pointing at a directory in the underlying FS.
685685
/// Will return false for paths to non-existent locations or if the item is
686686
/// not a directory (eg files, named pipes, links, etc)

src/libstd/io/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ pub trait Writer {
835835
/// Flush this output stream, ensuring that all intermediately buffered
836836
/// contents reach their destination.
837837
///
838-
/// This is by default a no-op and implementors of the `Writer` trait should
838+
/// This is by default a no-op and implementers of the `Writer` trait should
839839
/// decide whether their stream needs to be buffered or not.
840840
fn flush(&mut self) {}
841841

@@ -1057,7 +1057,7 @@ pub trait Buffer: Reader {
10571057
}
10581058
}
10591059

1060-
/// Reads a sequence of bytes leading up to a specified delimeter. Once the
1060+
/// Reads a sequence of bytes leading up to a specified delimiter. Once the
10611061
/// specified byte is encountered, reading ceases and the bytes up to and
10621062
/// including the delimiter are returned.
10631063
///
@@ -1156,7 +1156,7 @@ pub trait Seek {
11561156
/// A listener is a value that can consume itself to start listening for connections.
11571157
/// Doing so produces some sort of Acceptor.
11581158
pub trait Listener<T, A: Acceptor<T>> {
1159-
/// Spin up the listener and start queueing incoming connections
1159+
/// Spin up the listener and start queuing incoming connections
11601160
///
11611161
/// # Failure
11621162
///

src/libstd/io/native/process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl Process {
5050
/// * prog - the program to run
5151
/// * args - the arguments to pass to the program, not including the program
5252
/// itself
53-
/// * env - an optional envrionment to specify for the child process. If
53+
/// * env - an optional environment to specify for the child process. If
5454
/// this value is `None`, then the child will inherit the parent's
5555
/// environment
5656
/// * cwd - an optionally specified current working directory of the child,

src/libstd/io/signal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub enum Signum {
3434
Break = 21i,
3535
/// Equivalent to SIGHUP, delivered when the user closes the terminal
3636
/// window. On delivery of HangUp, the program is given approximately
37-
/// 10 seconds to perfom any cleanup. After that, Windows will
37+
/// 10 seconds to perform any cleanup. After that, Windows will
3838
/// unconditionally terminate it.
3939
HangUp = 1i,
4040
/// Equivalent to SIGINT, delivered when the user presses Ctrl-c.

src/libstd/iter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Composable external iterators
1515
# The `Iterator` trait
1616
1717
This module defines Rust's core iteration trait. The `Iterator` trait has one
18-
un-implemented method, `next`. All other methods are derived through default
18+
unimplemented method, `next`. All other methods are derived through default
1919
methods to perform operations such as `zip`, `chain`, `enumerate`, and `fold`.
2020
2121
The goal of this module is to unify iteration across all containers in Rust.
@@ -1688,7 +1688,7 @@ impl<A, T: RandomAccessIterator<A>> RandomAccessIterator<A> for Fuse<T> {
16881688

16891689
impl<T> Fuse<T> {
16901690
/// Resets the fuse such that the next call to .next() or .next_back() will
1691-
/// call the underlying iterator again even if it prevously returned None.
1691+
/// call the underlying iterator again even if it previously returned None.
16921692
#[inline]
16931693
pub fn reset_fuse(&mut self) {
16941694
self.done = false

src/libstd/local_data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ the TLS slot. Useful for dynamic variables, singletons, and interfacing with
1818
foreign code with bad callback interfaces.
1919
2020
To declare a new key for storing local data of a particular type, use the
21-
`local_data_key!` macro. This macro will expand to a `static` item apppriately
21+
`local_data_key!` macro. This macro will expand to a `static` item appropriately
2222
named and annotated. This name is then passed to the functions in this module to
2323
modify/read the slot specified by the key.
2424

src/libstd/num/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pub trait Fractional: Num
209209
pub trait Algebraic {
210210
/// Raise a number to a power.
211211
fn pow(&self, n: &Self) -> Self;
212-
/// Take the squre root of a number.
212+
/// Take the square root of a number.
213213
fn sqrt(&self) -> Self;
214214
/// Take the reciprocal (inverse) square root of a number, `1/sqrt(x)`.
215215
fn rsqrt(&self) -> Self;
@@ -229,7 +229,7 @@ pub trait Algebraic {
229229
/// assert_eq!(sixteen, 16.0);
230230
/// ```
231231
#[inline(always)] pub fn pow<T: Algebraic>(value: T, n: T) -> T { value.pow(&n) }
232-
/// Take the squre root of a number.
232+
/// Take the square root of a number.
233233
#[inline(always)] pub fn sqrt<T: Algebraic>(value: T) -> T { value.sqrt() }
234234
/// Take the reciprocal (inverse) square root of a number, `1/sqrt(x)`.
235235
#[inline(always)] pub fn rsqrt<T: Algebraic>(value: T) -> T { value.rsqrt() }

src/libstd/ops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ pub trait BitOr<RHS,Result> {
352352
* # Example
353353
*
354354
* A trivial implementation of `BitXor`. When `Foo ^ Foo` happens, it ends up
355-
* calling `bixtor`, and therefore, `main` prints `Bitwise Xor-ing!`.
355+
* calling `bitxor`, and therefore, `main` prints `Bitwise Xor-ing!`.
356356
*
357357
* ```
358358
* struct Foo;

src/libstd/rand/distributions/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub trait Sample<Support> {
4545

4646
/// `Sample`s that do not require keeping track of state.
4747
///
48-
/// Since no state is recored, each sample is (statistically)
48+
/// Since no state is recorded, each sample is (statistically)
4949
/// independent of all others, assuming the `Rng` used has this
5050
/// property.
5151
// XXX maybe having this separate is overkill (the only reason is to
@@ -84,15 +84,15 @@ pub struct Weighted<T> {
8484
/// is to be chosen: higher weight is more likely.
8585
///
8686
/// The `Clone` restriction is a limitation of the `Sample` and
87-
/// `IndepedentSample` traits. Note that `&T` is (cheaply) `Clone` for
87+
/// `IndependentSample` traits. Note that `&T` is (cheaply) `Clone` for
8888
/// all `T`, as is `uint`, so one can store references or indices into
8989
/// another vector.
9090
///
9191
/// # Example
9292
///
9393
/// ```rust
9494
/// use std::rand;
95-
/// use std::rand::distributions::{Weighted, WeightedChoice, IndepedentSample};
95+
/// use std::rand::distributions::{Weighted, WeightedChoice, IndependentSample};
9696
///
9797
/// fn main() {
9898
/// let wc = WeightedChoice::new(~[Weighted { weight: 2, item: 'a' },

src/libstd/rand/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub trait Rng {
119119
/// Fill `dest` with random data.
120120
///
121121
/// This has a default implementation in terms of `next_u64` and
122-
/// `next_u32`, but should be overriden by implementations that
122+
/// `next_u32`, but should be overridden by implementations that
123123
/// offer a more efficient solution than just calling those
124124
/// methods repeatedly.
125125
///

src/libstd/rt/sched.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub struct Scheduler {
7575
friend_handle: Option<SchedHandle>,
7676
/// A fast XorShift rng for scheduler use
7777
rng: XorShiftRng,
78-
/// A toggleable idle callback
78+
/// A togglable idle callback
7979
idle_callback: Option<~PausibleIdleCallback>,
8080
/// A countdown that starts at a random value and is decremented
8181
/// every time a yield check is performed. When it hits 0 a task

src/libstd/str.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -963,10 +963,9 @@ pub fn utf8_char_width(b: u8) -> uint {
963963
return UTF8_CHAR_WIDTH[b] as uint;
964964
}
965965

966-
/// Struct that contains a `char` and
967-
/// the index of the first byte of the next `char` in a string.
968-
/// This is being used as a datastructure for iterating over
969-
/// the utf8 bytes of a string.
966+
/// Struct that contains a `char` and the index of the first byte of
967+
/// the next `char` in a string. This can be used as a data structure
968+
/// for iterating over the UTF-8 bytes of a string.
970969
pub struct CharRange {
971970
/// Current `char`
972971
ch: char,
@@ -1570,7 +1569,8 @@ pub trait StrSlice<'a> {
15701569
/// ```
15711570
fn is_whitespace(&self) -> bool;
15721571

1573-
/// Returns true if the string contains only alphanumerics.
1572+
/// Returns true if the string contains only alphanumeric code
1573+
/// points.
15741574
///
15751575
/// Alphanumeric characters are determined by `char::is_alphanumeric`.
15761576
///
@@ -2518,7 +2518,7 @@ impl<'a> StrSlice<'a> for &'a str {
25182518

25192519
/// Methods for owned strings
25202520
pub trait OwnedStr {
2521-
/// Appends a string slice to the back of a string, without overallocating
2521+
/// Appends a string slice to the back of a string, without overallocating.
25222522
fn push_str_no_overallocate(&mut self, rhs: &str);
25232523

25242524
/// Appends a string slice to the back of a string

src/libstd/unstable/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
//! lock.unlock();
3838
//! }
3939
//!
40-
//! // Use a normally initialied mutex
40+
//! // Use a normally initialized mutex
4141
//! let mut lock = Mutex::new();
4242
//! unsafe {
4343
//! lock.lock();

src/libstd/vec.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ pub fn unzip<T, U, V: Iterator<(T, U)>>(mut iter: V) -> (~[T], ~[U]) {
402402
///
403403
/// The Steinhaus–Johnson–Trotter algorithm is used.
404404
///
405-
/// Generates even and odd permutations alternatingly.
405+
/// Generates even and odd permutations alternately.
406406
///
407407
/// The last generated swap is always (0, 1), and it returns the
408408
/// sequence to its initial order.
@@ -480,7 +480,7 @@ impl Iterator<(uint, uint)> for ElementSwaps {
480480
/// then each successive element is the vector with one
481481
/// swap applied.
482482
///
483-
/// Generates even and odd permutations alternatingly.
483+
/// Generates even and odd permutations alternately.
484484
pub struct Permutations<T> {
485485
priv swaps: ElementSwaps,
486486
priv v: ~[T],
@@ -940,7 +940,7 @@ pub trait ImmutableVector<'a, T> {
940940
fn tailn(&self, n: uint) -> &'a [T];
941941
/// Returns all but the last element of a vector
942942
fn init(&self) -> &'a [T];
943-
/// Returns all but the last `n' elemnts of a vector
943+
/// Returns all but the last `n' elements of a vector
944944
fn initn(&self, n: uint) -> &'a [T];
945945
/// Returns the last element of a vector, failing if the vector is empty.
946946
fn last(&self) -> &'a T;
@@ -958,9 +958,10 @@ pub trait ImmutableVector<'a, T> {
958958
/**
959959
* Binary search a sorted vector with a comparator function.
960960
*
961-
* The comparator should implement an order consistent with the sort
962-
* order of the underlying vector, returning an order code that indicates
963-
* whether its argument is `Less`, `Equal` or `Greater` the desired target.
961+
* The comparator function should implement an order consistent
962+
* with the sort order of the underlying vector, returning an
963+
* order code that indicates whether its argument is `Less`,
964+
* `Equal` or `Greater` the desired target.
964965
*
965966
* Returns the index where the comparator returned `Equal`, or `None` if
966967
* not found.
@@ -1436,14 +1437,14 @@ pub trait OwnedVector<T> {
14361437

14371438
/**
14381439
* Expands a vector in place, initializing the new elements to the result of
1439-
* a function
1440+
* a function.
14401441
*
14411442
* Function `init_op` is called `n` times with the values [0..`n`)
14421443
*
14431444
* # Arguments
14441445
*
14451446
* * n - The number of elements to add
1446-
* * init_op - A function to call to retreive each appended element's
1447+
* * init_op - A function to call to retrieve each appended element's
14471448
* value
14481449
*/
14491450
fn grow_fn(&mut self, n: uint, op: |uint| -> T);

0 commit comments

Comments
 (0)