From ed087015392adf58c497f884ecf116dc07952ce3 Mon Sep 17 00:00:00 2001 From: Alexander Lopatin Date: Mon, 1 Feb 2016 21:09:19 +0300 Subject: Fix a documentation typo --- src/libcore/sync/atomic.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libcore') diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index 21b76c1f4be..700a577e20c 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -711,7 +711,7 @@ impl AtomicUsize { /// ``` /// use std::sync::atomic::{AtomicUsize, Ordering}; /// - /// let some_usize= AtomicUsize::new(5); + /// let some_usize = AtomicUsize::new(5); /// /// assert_eq!(some_usize.swap(10, Ordering::Relaxed), 5); /// assert_eq!(some_usize.load(Ordering::Relaxed), 10); -- cgit 1.4.1-3-g733a5 From 4289973a2d95fa95a45b225c02ca8937f2b8c09e Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 27 Jan 2016 22:23:52 +0200 Subject: doc: bindings not needed for this example --- src/libcore/iter.rs | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) (limited to 'src/libcore') diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index 3f1c0f6a549..93514dbd6bb 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -2756,20 +2756,11 @@ pub trait Extend { /// /// let mut iter = numbers.iter(); /// -/// let n = iter.next(); -/// assert_eq!(Some(&1), n); -/// -/// let n = iter.next_back(); -/// assert_eq!(Some(&3), n); -/// -/// let n = iter.next_back(); -/// assert_eq!(Some(&2), n); -/// -/// let n = iter.next(); -/// assert_eq!(None, n); -/// -/// let n = iter.next_back(); -/// assert_eq!(None, n); +/// assert_eq!(Some(&1), iter.next()); +/// assert_eq!(Some(&3), iter.next_back()); +/// assert_eq!(Some(&2), iter.next_back()); +/// assert_eq!(None, iter.next()); +/// assert_eq!(None, iter.next_back()); /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub trait DoubleEndedIterator: Iterator { @@ -2789,20 +2780,11 @@ pub trait DoubleEndedIterator: Iterator { /// /// let mut iter = numbers.iter(); /// - /// let n = iter.next(); - /// assert_eq!(Some(&1), n); - /// - /// let n = iter.next_back(); - /// assert_eq!(Some(&3), n); - /// - /// let n = iter.next_back(); - /// assert_eq!(Some(&2), n); - /// - /// let n = iter.next(); - /// assert_eq!(None, n); - /// - /// let n = iter.next_back(); - /// assert_eq!(None, n); + /// assert_eq!(Some(&1), iter.next()); + /// assert_eq!(Some(&3), iter.next_back()); + /// assert_eq!(Some(&2), iter.next_back()); + /// assert_eq!(None, iter.next()); + /// assert_eq!(None, iter.next_back()); /// ``` #[stable(feature = "rust1", since = "1.0.0")] fn next_back(&mut self) -> Option; -- cgit 1.4.1-3-g733a5 From 129a6239d28aeaea87a9d27191e50b55e6b8923a Mon Sep 17 00:00:00 2001 From: Kamal Marhubi Date: Mon, 1 Feb 2016 21:41:29 -0500 Subject: docs: Standardize on 'Errors' header in std docs --- src/libcollections/str.rs | 2 +- src/libcollections/string.rs | 2 +- src/libcore/str/mod.rs | 2 +- src/librustc_unicode/char.rs | 2 +- src/libstd/fs.rs | 2 +- src/libstd/sync/condvar.rs | 2 +- src/libstd/sync/mutex.rs | 8 ++++---- src/libstd/sync/rwlock.rs | 12 ++++++------ src/libstd/sys/common/remutex.rs | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/libcore') diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 094b7f1d034..118675ab2c5 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -1644,7 +1644,7 @@ impl str { /// /// [`FromStr`]: str/trait.FromStr.html /// - /// # Failure + /// # Errors /// /// Will return `Err` if it's not possible to parse this string slice into /// the desired type. diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 97c12043e76..b1242ba6d4d 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -433,7 +433,7 @@ impl String { /// /// [`str::from_utf8()`]: ../str/fn.from_utf8.html /// - /// # Failure + /// # Errors /// /// Returns `Err` if the slice is not UTF-8 with a description as to why the /// provided bytes are not UTF-8. The vector you moved in is also included. diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 3892455395f..f19970546d7 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -188,7 +188,7 @@ impl Utf8Error { /// it, this function is one way to have a stack-allocated string. There is /// an example of this in the examples section below. /// -/// # Failure +/// # Errors /// /// Returns `Err` if the slice is not UTF-8 with a description as to why the /// provided slice is not UTF-8. diff --git a/src/librustc_unicode/char.rs b/src/librustc_unicode/char.rs index 46ecd3a80b5..9386453d660 100644 --- a/src/librustc_unicode/char.rs +++ b/src/librustc_unicode/char.rs @@ -194,7 +194,7 @@ impl char { /// * `a-z` /// * `A-Z` /// - /// # Failure + /// # Errors /// /// Returns `None` if the `char` does not refer to a digit in the given radix. /// diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index e40a3d06f77..d12cfa6183a 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -70,7 +70,7 @@ pub struct Metadata(fs_imp::FileAttr); /// information like the entry's path and possibly other metadata can be /// learned. /// -/// # Failure +/// # Errors /// /// This `io::Result` will be an `Err` if there's some sort of intermittent /// IO error during iteration. diff --git a/src/libstd/sync/condvar.rs b/src/libstd/sync/condvar.rs index 1f7fe820bf8..9a786752365 100644 --- a/src/libstd/sync/condvar.rs +++ b/src/libstd/sync/condvar.rs @@ -129,7 +129,7 @@ impl Condvar { /// the predicate must always be checked each time this function returns to /// protect against spurious wakeups. /// - /// # Failure + /// # Errors /// /// This function will return an error if the mutex being waited on is /// poisoned when this thread re-acquires the lock. For more information, diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index 6b20e51967d..fe9f0371abd 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -205,7 +205,7 @@ impl Mutex { /// held. An RAII guard is returned to allow scoped unlock of the lock. When /// the guard goes out of scope, the mutex will be unlocked. /// - /// # Failure + /// # Errors /// /// If another user of this mutex panicked while holding the mutex, then /// this call will return an error once the mutex is acquired. @@ -223,7 +223,7 @@ impl Mutex { /// /// This function does not block. /// - /// # Failure + /// # Errors /// /// If another user of this mutex panicked while holding the mutex, then /// this call will return failure if the mutex would otherwise be @@ -250,7 +250,7 @@ impl Mutex { /// Consumes this mutex, returning the underlying data. /// - /// # Failure + /// # Errors /// /// If another user of this mutex panicked while holding the mutex, then /// this call will return an error instead. @@ -280,7 +280,7 @@ impl Mutex { /// Since this call borrows the `Mutex` mutably, no actual locking needs to /// take place---the mutable borrow statically guarantees no locks exist. /// - /// # Failure + /// # Errors /// /// If another user of this mutex panicked while holding the mutex, then /// this call will return an error instead. diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index 3dbef435481..63ef7732ad6 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -169,7 +169,7 @@ impl RwLock { /// Returns an RAII guard which will release this thread's shared access /// once it is dropped. /// - /// # Failure + /// # Errors /// /// This function will return an error if the RwLock is poisoned. An RwLock /// is poisoned whenever a writer panics while holding an exclusive lock. @@ -192,7 +192,7 @@ impl RwLock { /// This function does not provide any guarantees with respect to the ordering /// of whether contentious readers or writers will acquire the lock first. /// - /// # Failure + /// # Errors /// /// This function will return an error if the RwLock is poisoned. An RwLock /// is poisoned whenever a writer panics while holding an exclusive lock. An @@ -217,7 +217,7 @@ impl RwLock { /// Returns an RAII guard which will drop the write access of this rwlock /// when dropped. /// - /// # Failure + /// # Errors /// /// This function will return an error if the RwLock is poisoned. An RwLock /// is poisoned whenever a writer panics while holding an exclusive lock. @@ -240,7 +240,7 @@ impl RwLock { /// This function does not provide any guarantees with respect to the ordering /// of whether contentious readers or writers will acquire the lock first. /// - /// # Failure + /// # Errors /// /// This function will return an error if the RwLock is poisoned. An RwLock /// is poisoned whenever a writer panics while holding an exclusive lock. An @@ -269,7 +269,7 @@ impl RwLock { /// Consumes this `RwLock`, returning the underlying data. /// - /// # Failure + /// # Errors /// /// This function will return an error if the RwLock is poisoned. An RwLock /// is poisoned whenever a writer panics while holding an exclusive lock. An @@ -301,7 +301,7 @@ impl RwLock { /// Since this call borrows the `RwLock` mutably, no actual locking needs to /// take place---the mutable borrow statically guarantees no locks exist. /// - /// # Failure + /// # Errors /// /// This function will return an error if the RwLock is poisoned. An RwLock /// is poisoned whenever a writer panics while holding an exclusive lock. An diff --git a/src/libstd/sys/common/remutex.rs b/src/libstd/sys/common/remutex.rs index 31caa68c4b7..2e2be63c3cb 100644 --- a/src/libstd/sys/common/remutex.rs +++ b/src/libstd/sys/common/remutex.rs @@ -78,7 +78,7 @@ impl ReentrantMutex { /// calling this method already holds the lock, the call shall succeed without /// blocking. /// - /// # Failure + /// # Errors /// /// If another user of this mutex panicked while holding the mutex, then /// this call will return failure if the mutex would otherwise be @@ -95,7 +95,7 @@ impl ReentrantMutex { /// /// This function does not block. /// - /// # Failure + /// # Errors /// /// If another user of this mutex panicked while holding the mutex, then /// this call will return failure if the mutex would otherwise be -- cgit 1.4.1-3-g733a5