doc: correct spelling in documentation.
This commit is contained in:
parent
1ad0cf5841
commit
abe94f9b4d
23 changed files with 35 additions and 36 deletions
|
@ -582,7 +582,7 @@ a referencing source file, or by the name of the crate itself.
|
||||||
|
|
||||||
Each source file contains a sequence of zero or more `item` definitions,
|
Each source file contains a sequence of zero or more `item` definitions,
|
||||||
and may optionally begin with any number of `attributes` that apply to the containing module.
|
and may optionally begin with any number of `attributes` that apply to the containing module.
|
||||||
Atributes on the anonymous crate module define important metadata that influences
|
Attributes on the anonymous crate module define important metadata that influences
|
||||||
the behavior of the compiler.
|
the behavior of the compiler.
|
||||||
|
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
|
@ -1273,7 +1273,7 @@ since the typechecker checks that any type with an implementation of `Circle` al
|
||||||
|
|
||||||
In type-parameterized functions,
|
In type-parameterized functions,
|
||||||
methods of the supertrait may be called on values of subtrait-bound type parameters.
|
methods of the supertrait may be called on values of subtrait-bound type parameters.
|
||||||
Refering to the previous example of `trait Circle : Shape`:
|
Referring to the previous example of `trait Circle : Shape`:
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
# trait Shape { fn area(&self) -> float; }
|
# trait Shape { fn area(&self) -> float; }
|
||||||
|
@ -1914,7 +1914,7 @@ A field access on a record is an [lvalue](#lvalues-rvalues-and-temporaries) refe
|
||||||
When the field is mutable, it can be [assigned](#assignment-expressions) to.
|
When the field is mutable, it can be [assigned](#assignment-expressions) to.
|
||||||
|
|
||||||
When the type of the expression to the left of the dot is a pointer to a record or structure,
|
When the type of the expression to the left of the dot is a pointer to a record or structure,
|
||||||
it is automatically derferenced to make the field access possible.
|
it is automatically dereferenced to make the field access possible.
|
||||||
|
|
||||||
|
|
||||||
### Vector expressions
|
### Vector expressions
|
||||||
|
|
|
@ -18,7 +18,7 @@ pub struct EnumSet<E> {
|
||||||
priv bits: uint
|
priv bits: uint
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An iterface for casting C-like enum to uint and back.
|
/// An interface for casting C-like enum to uint and back.
|
||||||
pub trait CLike {
|
pub trait CLike {
|
||||||
/// Converts C-like enum to uint.
|
/// Converts C-like enum to uint.
|
||||||
fn to_uint(&self) -> uint;
|
fn to_uint(&self) -> uint;
|
||||||
|
|
|
@ -166,7 +166,7 @@ Constructors for flat pipes that send POD types using memcpy.
|
||||||
|
|
||||||
This module is currently unsafe because it uses `Clone + Send` as a type
|
This module is currently unsafe because it uses `Clone + Send` as a type
|
||||||
parameter bounds meaning POD (plain old data), but `Clone + Send` and
|
parameter bounds meaning POD (plain old data), but `Clone + Send` and
|
||||||
POD are not equivelant.
|
POD are not equivalent.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
pub mod pod {
|
pub mod pod {
|
||||||
|
|
|
@ -365,7 +365,7 @@ pub fn write_boxplot(w: @io::Writer, s: &Summary, width_hint: uint) {
|
||||||
w.write_str(histr);
|
w.write_str(histr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a HashMap with the number of occurences of every element in the
|
/// Returns a HashMap with the number of occurrences of every element in the
|
||||||
/// sequence that the iterator exposes.
|
/// sequence that the iterator exposes.
|
||||||
pub fn freq_count<T: Iterator<U>, U: Eq+Hash>(mut iter: T) -> hashmap::HashMap<U, uint> {
|
pub fn freq_count<T: Iterator<U>, U: Eq+Hash>(mut iter: T) -> hashmap::HashMap<U, uint> {
|
||||||
let mut map = hashmap::HashMap::new::<U, uint>();
|
let mut map = hashmap::HashMap::new::<U, uint>();
|
||||||
|
|
|
@ -200,7 +200,7 @@ pub mod raw {
|
||||||
* Sets the length of a vector
|
* Sets the length of a vector
|
||||||
*
|
*
|
||||||
* This will explicitly set the size of the vector, without actually
|
* This will explicitly set the size of the vector, without actually
|
||||||
* modifing its buffers, so it is up to the caller to ensure that
|
* modifying its buffers, so it is up to the caller to ensure that
|
||||||
* the vector is actually the specified size.
|
* the vector is actually the specified size.
|
||||||
*/
|
*/
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
|
@ -33,7 +33,7 @@ and more.
|
||||||
|
|
||||||
Also, a few conversion functions: `to_bit` and `to_str`.
|
Also, a few conversion functions: `to_bit` and `to_str`.
|
||||||
|
|
||||||
Finally, some inquries into the nature of truth: `is_true` and `is_false`.
|
Finally, some inquiries into the nature of truth: `is_true` and `is_false`.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,7 @@ helper methods.
|
||||||
## Internationalization
|
## Internationalization
|
||||||
|
|
||||||
The formatting syntax supported by the `ifmt!` extension supports
|
The formatting syntax supported by the `ifmt!` extension supports
|
||||||
internationalization by providing "methods" which execute various differnet
|
internationalization by providing "methods" which execute various different
|
||||||
outputs depending on the input. The syntax and methods provided are similar to
|
outputs depending on the input. The syntax and methods provided are similar to
|
||||||
other internationalization systems, so again nothing should seem alien.
|
other internationalization systems, so again nothing should seem alien.
|
||||||
Currently two methods are supported by this extension: "select" and "plural".
|
Currently two methods are supported by this extension: "select" and "plural".
|
||||||
|
|
|
@ -66,7 +66,7 @@ pub enum Position<'self> {
|
||||||
ArgumentNext, ArgumentIs(uint), ArgumentNamed(&'self str)
|
ArgumentNext, ArgumentIs(uint), ArgumentNamed(&'self str)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Enum of alignments which are supoprted.
|
/// Enum of alignments which are supported.
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
pub enum Alignment { AlignLeft, AlignRight, AlignUnknown }
|
pub enum Alignment { AlignLeft, AlignRight, AlignUnknown }
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ pub static neg_infinity: f32 = -1.0_f32/0.0_f32;
|
||||||
pub mod consts {
|
pub mod consts {
|
||||||
// FIXME (requires Issue #1433 to fix): replace with mathematical
|
// FIXME (requires Issue #1433 to fix): replace with mathematical
|
||||||
// staticants from cmath.
|
// staticants from cmath.
|
||||||
/// Archimedes' staticant
|
/// Archimedes' constant
|
||||||
pub static pi: f32 = 3.14159265358979323846264338327950288_f32;
|
pub static pi: f32 = 3.14159265358979323846264338327950288_f32;
|
||||||
|
|
||||||
/// pi/2.0
|
/// pi/2.0
|
||||||
|
|
|
@ -254,7 +254,7 @@ pub unsafe fn array_each_with_len<T>(arr: **T, len: uint, cb: &fn(*T)) {
|
||||||
passing to the provided callback function
|
passing to the provided callback function
|
||||||
|
|
||||||
SAFETY NOTE: This will only work with a null-terminated
|
SAFETY NOTE: This will only work with a null-terminated
|
||||||
pointer array. Barely less-dodgey Pointer Arithmetic.
|
pointer array. Barely less-dodgy Pointer Arithmetic.
|
||||||
Dragons be here.
|
Dragons be here.
|
||||||
*/
|
*/
|
||||||
pub unsafe fn array_each<T>(arr: **T, cb: &fn(*T)) {
|
pub unsafe fn array_each<T>(arr: **T, cb: &fn(*T)) {
|
||||||
|
|
|
@ -658,7 +658,7 @@ pub fn rng() -> IsaacRng {
|
||||||
|
|
||||||
/// Create a weak random number generator with a default algorithm and seed.
|
/// Create a weak random number generator with a default algorithm and seed.
|
||||||
///
|
///
|
||||||
/// It returns the fatest `Rng` algorithm currently available in Rust without
|
/// It returns the fastest `Rng` algorithm currently available in Rust without
|
||||||
/// consideration for cryptography or security. If you require a specifically
|
/// consideration for cryptography or security. If you require a specifically
|
||||||
/// seeded `Rng` for consistency over time you should pick one algorithm and
|
/// seeded `Rng` for consistency over time you should pick one algorithm and
|
||||||
/// create the `Rng` yourself.
|
/// create the `Rng` yourself.
|
||||||
|
|
|
@ -25,7 +25,7 @@ use str::StrSlice;
|
||||||
|
|
||||||
/// `Result` is a type that represents either success (`Ok`) or failure (`Err`).
|
/// `Result` is a type that represents either success (`Ok`) or failure (`Err`).
|
||||||
///
|
///
|
||||||
/// In order to provide informative error messages, `E` is reqired to implement `ToStr`.
|
/// In order to provide informative error messages, `E` is required to implement `ToStr`.
|
||||||
/// It is further recommended for `E` to be a descriptive error type, eg a `enum` for
|
/// It is further recommended for `E` to be a descriptive error type, eg a `enum` for
|
||||||
/// all possible errors cases.
|
/// all possible errors cases.
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
|
|
|
@ -93,7 +93,7 @@ Asynchronous interfaces are most often associated with the callback
|
||||||
(continuation-passing) style popularised by node.js. Such systems rely
|
(continuation-passing) style popularised by node.js. Such systems rely
|
||||||
on all computations being run inside an event loop which maintains a
|
on all computations being run inside an event loop which maintains a
|
||||||
list of all pending I/O events; when one completes the registered
|
list of all pending I/O events; when one completes the registered
|
||||||
callback is run and the code that made the I/O request continiues.
|
callback is run and the code that made the I/O request continues.
|
||||||
Such interfaces achieve non-blocking at the expense of being more
|
Such interfaces achieve non-blocking at the expense of being more
|
||||||
difficult to reason about.
|
difficult to reason about.
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ Rust's I/O employs a combination of techniques to reduce boilerplate
|
||||||
while still providing feedback about errors. The basic strategy:
|
while still providing feedback about errors. The basic strategy:
|
||||||
|
|
||||||
* Errors are fatal by default, resulting in task failure
|
* Errors are fatal by default, resulting in task failure
|
||||||
* Errors raise the `io_error` conditon which provides an opportunity to inspect
|
* Errors raise the `io_error` condition which provides an opportunity to inspect
|
||||||
an IoError object containing details.
|
an IoError object containing details.
|
||||||
* Return values must have a sensible null or zero value which is returned
|
* Return values must have a sensible null or zero value which is returned
|
||||||
if a condition is handled successfully. This may be an `Option`, an empty
|
if a condition is handled successfully. This may be an `Option`, an empty
|
||||||
|
@ -189,7 +189,7 @@ will start passing around null or zero objects when wrapped in a condition handl
|
||||||
* XXX: How should we use condition handlers that return values?
|
* XXX: How should we use condition handlers that return values?
|
||||||
* XXX: Should EOF raise default conditions when EOF is not an error?
|
* XXX: Should EOF raise default conditions when EOF is not an error?
|
||||||
|
|
||||||
# Issues withi/o scheduler affinity, work stealing, task pinning
|
# Issues with i/o scheduler affinity, work stealing, task pinning
|
||||||
|
|
||||||
# Resource management
|
# Resource management
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ pub struct Coroutine {
|
||||||
saved_context: Context
|
saved_context: Context
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Some tasks have a deciated home scheduler that they must run on.
|
/// Some tasks have a dedicated home scheduler that they must run on.
|
||||||
pub enum SchedHome {
|
pub enum SchedHome {
|
||||||
AnySched,
|
AnySched,
|
||||||
Sched(SchedHandle)
|
Sched(SchedHandle)
|
||||||
|
@ -592,4 +592,3 @@ mod test {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
* There are also a collection of helper functions to ease interacting
|
* There are also a collection of helper functions to ease interacting
|
||||||
* with the low-level API.
|
* with the low-level API.
|
||||||
*
|
*
|
||||||
* As new functionality, existant in uv.h, is added to the rust stdlib,
|
* As new functionality, existent in uv.h, is added to the rust stdlib,
|
||||||
* the mappings should be added in this module.
|
* the mappings should be added in this module.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ pub struct ProcessOptions<'self> {
|
||||||
in_fd: Option<c_int>,
|
in_fd: Option<c_int>,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If this is None then a new pipe will be created for the new progam's
|
* If this is None then a new pipe will be created for the new program's
|
||||||
* output and Process.output() will provide a Reader to read from this pipe.
|
* output and Process.output() will provide a Reader to read from this pipe.
|
||||||
*
|
*
|
||||||
* If this is Some(file-descriptor) then the new process will write its output
|
* If this is Some(file-descriptor) then the new process will write its output
|
||||||
|
@ -100,7 +100,7 @@ pub struct ProcessOptions<'self> {
|
||||||
out_fd: Option<c_int>,
|
out_fd: Option<c_int>,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If this is None then a new pipe will be created for the new progam's
|
* If this is None then a new pipe will be created for the new program's
|
||||||
* error stream and Process.error() will provide a Reader to read from this pipe.
|
* error stream and Process.error() will provide a Reader to read from this pipe.
|
||||||
*
|
*
|
||||||
* If this is Some(file-descriptor) then the new process will write its error output
|
* If this is Some(file-descriptor) then the new process will write its error output
|
||||||
|
@ -840,7 +840,7 @@ pub fn process_output(prog: &str, args: &[~str]) -> ProcessOutput {
|
||||||
* Note that this is private to avoid race conditions on unix where if
|
* Note that this is private to avoid race conditions on unix where if
|
||||||
* a user calls waitpid(some_process.get_id()) then some_process.finish()
|
* a user calls waitpid(some_process.get_id()) then some_process.finish()
|
||||||
* and some_process.destroy() and some_process.finalize() will then either
|
* and some_process.destroy() and some_process.finalize() will then either
|
||||||
* operate on a none-existant process or, even worse, on a newer process
|
* operate on a none-existent process or, even worse, on a newer process
|
||||||
* with the same id.
|
* with the same id.
|
||||||
*/
|
*/
|
||||||
fn waitpid(pid: pid_t) -> int {
|
fn waitpid(pid: pid_t) -> int {
|
||||||
|
|
|
@ -382,7 +382,7 @@ impl<'self, Sep: CharEq> Iterator<&'self str> for CharSplitIterator<'self, Sep>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An iterator over the start and end indicies of the matches of a
|
/// An iterator over the start and end indices of the matches of a
|
||||||
/// substring within a larger string
|
/// substring within a larger string
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct MatchesIndexIterator<'self> {
|
pub struct MatchesIndexIterator<'self> {
|
||||||
|
@ -893,7 +893,7 @@ pub mod raw {
|
||||||
/// Sets the length of a string
|
/// Sets the length of a string
|
||||||
///
|
///
|
||||||
/// This will explicitly set the size of the string, without actually
|
/// This will explicitly set the size of the string, without actually
|
||||||
/// modifing its buffers, so it is up to the caller to ensure that
|
/// modifying its buffers, so it is up to the caller to ensure that
|
||||||
/// the string is actually the specified size.
|
/// the string is actually the specified size.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn set_len(s: &mut ~str, new_len: uint) {
|
pub unsafe fn set_len(s: &mut ~str, new_len: uint) {
|
||||||
|
|
|
@ -365,7 +365,7 @@ impl TaskBuilder {
|
||||||
spawn::spawn_raw(opts, f);
|
spawn::spawn_raw(opts, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Runs a task, while transfering ownership of one argument to the child.
|
/// Runs a task, while transferring ownership of one argument to the child.
|
||||||
pub fn spawn_with<A:Send>(&mut self, arg: A, f: ~fn(v: A)) {
|
pub fn spawn_with<A:Send>(&mut self, arg: A, f: ~fn(v: A)) {
|
||||||
let arg = Cell::new(arg);
|
let arg = Cell::new(arg);
|
||||||
do self.spawn {
|
do self.spawn {
|
||||||
|
@ -474,10 +474,10 @@ pub fn spawn_indestructible(f: ~fn()) {
|
||||||
|
|
||||||
pub fn spawn_with<A:Send>(arg: A, f: ~fn(v: A)) {
|
pub fn spawn_with<A:Send>(arg: A, f: ~fn(v: A)) {
|
||||||
/*!
|
/*!
|
||||||
* Runs a task, while transfering ownership of one argument to the
|
* Runs a task, while transferring ownership of one argument to the
|
||||||
* child.
|
* child.
|
||||||
*
|
*
|
||||||
* This is useful for transfering ownership of noncopyables to
|
* This is useful for transferring ownership of noncopyables to
|
||||||
* another task.
|
* another task.
|
||||||
*
|
*
|
||||||
* This function is equivalent to `task().spawn_with(arg, f)`.
|
* This function is equivalent to `task().spawn_with(arg, f)`.
|
||||||
|
|
|
@ -28,7 +28,7 @@ pub type Cb<'self> = &'self fn(buf: &[u8]) -> bool;
|
||||||
* A trait to implement in order to make a type hashable;
|
* A trait to implement in order to make a type hashable;
|
||||||
* This works in combination with the trait `Hash::Hash`, and
|
* This works in combination with the trait `Hash::Hash`, and
|
||||||
* may in the future be merged with that trait or otherwise
|
* may in the future be merged with that trait or otherwise
|
||||||
* modified when default methods and trait inheritence are
|
* modified when default methods and trait inheritance are
|
||||||
* completed.
|
* completed.
|
||||||
*/
|
*/
|
||||||
pub trait IterBytes {
|
pub trait IterBytes {
|
||||||
|
|
|
@ -39,14 +39,14 @@ pub struct AtomicBool {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A signed atomic integer type, supporting basic atomic aritmetic operations
|
* A signed atomic integer type, supporting basic atomic arithmetic operations
|
||||||
*/
|
*/
|
||||||
pub struct AtomicInt {
|
pub struct AtomicInt {
|
||||||
priv v: int
|
priv v: int
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An unsigned atomic integer type, supporting basic atomic aritmetic operations
|
* An unsigned atomic integer type, supporting basic atomic arithmetic operations
|
||||||
*/
|
*/
|
||||||
pub struct AtomicUint {
|
pub struct AtomicUint {
|
||||||
priv v: uint
|
priv v: uint
|
||||||
|
@ -497,7 +497,7 @@ pub unsafe fn atomic_xor<T>(dst: &mut T, val: T, order: Ordering) -> T {
|
||||||
* A fence 'A' which has `Release` ordering semantics, synchronizes with a
|
* A fence 'A' which has `Release` ordering semantics, synchronizes with a
|
||||||
* fence 'B' with (at least) `Acquire` semantics, if and only if there exists
|
* fence 'B' with (at least) `Acquire` semantics, if and only if there exists
|
||||||
* atomic operations X and Y, both operating on some atomic object 'M' such
|
* atomic operations X and Y, both operating on some atomic object 'M' such
|
||||||
* that A is sequenced before X, Y is synchronized before B and Y obsevers
|
* that A is sequenced before X, Y is synchronized before B and Y observers
|
||||||
* the change to M. This provides a happens-before dependence between A and B.
|
* the change to M. This provides a happens-before dependence between A and B.
|
||||||
*
|
*
|
||||||
* Atomic operations with `Release` or `Acquire` semantics can also synchronize
|
* Atomic operations with `Release` or `Acquire` semantics can also synchronize
|
||||||
|
|
|
@ -18,7 +18,7 @@ stack closures that emulates Java-style try/finally blocks.
|
||||||
do || {
|
do || {
|
||||||
...
|
...
|
||||||
}.finally {
|
}.finally {
|
||||||
alway_run_this();
|
always_run_this();
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -22,7 +22,7 @@ semantics as C++11. See the LLVM documentation on [[atomics]].
|
||||||
|
|
||||||
A quick refresher on memory ordering:
|
A quick refresher on memory ordering:
|
||||||
|
|
||||||
* Acquire - a barrier for aquiring a lock. Subsequent reads and writes
|
* Acquire - a barrier for acquiring a lock. Subsequent reads and writes
|
||||||
take place after the barrier.
|
take place after the barrier.
|
||||||
* Release - a barrier for releasing a lock. Preceding reads and writes
|
* Release - a barrier for releasing a lock. Preceding reads and writes
|
||||||
take place before the barrier.
|
take place before the barrier.
|
||||||
|
|
|
@ -468,7 +468,7 @@ impl<'self, T> Iterator<&'self [T]> for WindowIter<'self, T> {
|
||||||
/// elements at a time).
|
/// elements at a time).
|
||||||
///
|
///
|
||||||
/// When the vector len is not evenly divided by the chunk size,
|
/// When the vector len is not evenly divided by the chunk size,
|
||||||
/// the last slice of the iteration will be the remainer.
|
/// the last slice of the iteration will be the remainder.
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct ChunkIter<'self, T> {
|
pub struct ChunkIter<'self, T> {
|
||||||
priv v: &'self [T],
|
priv v: &'self [T],
|
||||||
|
@ -1930,7 +1930,7 @@ pub mod raw {
|
||||||
* Sets the length of a vector
|
* Sets the length of a vector
|
||||||
*
|
*
|
||||||
* This will explicitly set the size of the vector, without actually
|
* This will explicitly set the size of the vector, without actually
|
||||||
* modifing its buffers, so it is up to the caller to ensure that
|
* modifying its buffers, so it is up to the caller to ensure that
|
||||||
* the vector is actually the specified size.
|
* the vector is actually the specified size.
|
||||||
*/
|
*/
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue