diff options
| author | Stjepan Glavina <stjepang@gmail.com> | 2017-03-22 01:42:23 +0100 |
|---|---|---|
| committer | Stjepan Glavina <stjepang@gmail.com> | 2017-03-22 17:19:52 +0100 |
| commit | d6da1d9b46f7090b18be357bef8d55ffa3673d2f (patch) | |
| tree | b1af890ad3f0728432eec3c8049e20789b7eb75d /src/libcore | |
| parent | cab4bff3de1a61472f3c2e7752ef54b87344d1c9 (diff) | |
| download | rust-d6da1d9b46f7090b18be357bef8d55ffa3673d2f.tar.gz rust-d6da1d9b46f7090b18be357bef8d55ffa3673d2f.zip | |
Various fixes to wording consistency in the docs
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/any.rs | 2 | ||||
| -rw-r--r-- | src/libcore/cmp.rs | 6 | ||||
| -rw-r--r-- | src/libcore/iter_private.rs | 2 | ||||
| -rw-r--r-- | src/libcore/num/bignum.rs | 6 | ||||
| -rw-r--r-- | src/libcore/num/mod.rs | 8 | ||||
| -rw-r--r-- | src/libcore/ptr.rs | 4 | ||||
| -rw-r--r-- | src/libcore/result.rs | 4 | ||||
| -rw-r--r-- | src/libcore/slice/mod.rs | 10 | ||||
| -rw-r--r-- | src/libcore/slice/sort.rs | 4 | ||||
| -rw-r--r-- | src/libcore/str/mod.rs | 14 |
10 files changed, 30 insertions, 30 deletions
diff --git a/src/libcore/any.rs b/src/libcore/any.rs index b8a4174766a..338e5c7fd95 100644 --- a/src/libcore/any.rs +++ b/src/libcore/any.rs @@ -137,7 +137,7 @@ impl fmt::Debug for Any + Send { } impl Any { - /// Returns true if the boxed type is the same as `T`. + /// Returns `true` if the boxed type is the same as `T`. /// /// # Examples /// diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index cb39796eecd..7db35359a1f 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -210,7 +210,7 @@ pub enum Ordering { } impl Ordering { - /// Reverse the `Ordering`. + /// Reverses the `Ordering`. /// /// * `Less` becomes `Greater`. /// * `Greater` becomes `Less`. @@ -616,7 +616,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> { } } -/// Compare and return the minimum of two values. +/// Compares and returns the minimum of two values. /// /// Returns the first argument if the comparison determines them to be equal. /// @@ -634,7 +634,7 @@ pub fn min<T: Ord>(v1: T, v2: T) -> T { if v1 <= v2 { v1 } else { v2 } } -/// Compare and return the maximum of two values. +/// Compares and returns the maximum of two values. /// /// Returns the second argument if the comparison determines them to be equal. /// diff --git a/src/libcore/iter_private.rs b/src/libcore/iter_private.rs index bc1aaa09f3d..c4d54d2c7b8 100644 --- a/src/libcore/iter_private.rs +++ b/src/libcore/iter_private.rs @@ -22,7 +22,7 @@ #[doc(hidden)] pub unsafe trait TrustedRandomAccess : ExactSizeIterator { unsafe fn get_unchecked(&mut self, i: usize) -> Self::Item; - /// Return `true` if getting an iterator element may have + /// Returns `true` if getting an iterator element may have /// side effects. Remember to take inner iterators into account. fn may_have_side_effect() -> bool; } diff --git a/src/libcore/num/bignum.rs b/src/libcore/num/bignum.rs index a1f4630c304..8904322ca48 100644 --- a/src/libcore/num/bignum.rs +++ b/src/libcore/num/bignum.rs @@ -148,14 +148,14 @@ macro_rules! define_bignum { $name { size: sz, base: base } } - /// Return the internal digits as a slice `[a, b, c, ...]` such that the numeric + /// Returns the internal digits as a slice `[a, b, c, ...]` such that the numeric /// value is `a + b * 2^W + c * 2^(2W) + ...` where `W` is the number of bits in /// the digit type. pub fn digits(&self) -> &[$ty] { &self.base[..self.size] } - /// Return the `i`-th bit where bit 0 is the least significant one. + /// Returns the `i`-th bit where bit 0 is the least significant one. /// In other words, the bit with weight `2^i`. pub fn get_bit(&self, i: usize) -> u8 { use mem; @@ -166,7 +166,7 @@ macro_rules! define_bignum { ((self.base[d] >> b) & 1) as u8 } - /// Returns true if the bignum is zero. + /// Returns `true` if the bignum is zero. pub fn is_zero(&self) -> bool { self.digits().iter().all(|&v| v == 0) } diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index ccfe6364e6a..df343c9d45f 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -2568,17 +2568,17 @@ pub trait Float: Sized { implementable outside the standard library")] fn one() -> Self; - /// Returns true if this value is NaN and false otherwise. + /// Returns `true` if this value is NaN and false otherwise. #[stable(feature = "core", since = "1.6.0")] fn is_nan(self) -> bool; - /// Returns true if this value is positive infinity or negative infinity and + /// Returns `true` if this value is positive infinity or negative infinity and /// false otherwise. #[stable(feature = "core", since = "1.6.0")] fn is_infinite(self) -> bool; - /// Returns true if this number is neither infinite nor NaN. + /// Returns `true` if this number is neither infinite nor NaN. #[stable(feature = "core", since = "1.6.0")] fn is_finite(self) -> bool; - /// Returns true if this number is neither zero, infinite, denormal, or NaN. + /// Returns `true` if this number is neither zero, infinite, denormal, or NaN. #[stable(feature = "core", since = "1.6.0")] fn is_normal(self) -> bool; /// Returns the category that this number falls into. diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 98544f8ba5e..d2830a6d00c 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -380,7 +380,7 @@ pub unsafe fn write_volatile<T>(dst: *mut T, src: T) { #[lang = "const_ptr"] impl<T: ?Sized> *const T { - /// Returns true if the pointer is null. + /// Returns `true` if the pointer is null. /// /// # Examples /// @@ -504,7 +504,7 @@ impl<T: ?Sized> *const T { #[lang = "mut_ptr"] impl<T: ?Sized> *mut T { - /// Returns true if the pointer is null. + /// Returns `true` if the pointer is null. /// /// # Examples /// diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 00ff2fd2ce5..6ec8a37dfa4 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -268,7 +268,7 @@ impl<T, E> Result<T, E> { // Querying the contained values ///////////////////////////////////////////////////////////////////////// - /// Returns true if the result is `Ok`. + /// Returns `true` if the result is `Ok`. /// /// # Examples /// @@ -290,7 +290,7 @@ impl<T, E> Result<T, E> { } } - /// Returns true if the result is `Err`. + /// Returns `true` if the result is `Err`. /// /// # Examples /// diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index 6f8b199f886..af492b3c639 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -1511,7 +1511,7 @@ fn ptrdistance<T>(start: *const T, end: *const T) -> usize { trait PointerExt : Copy { unsafe fn slice_offset(self, i: isize) -> Self; - /// Increment self by 1, but return the old value + /// Increments `self` by 1, but returns the old value. #[inline(always)] unsafe fn post_inc(&mut self) -> Self { let current = *self; @@ -1519,7 +1519,7 @@ trait PointerExt : Copy { current } - /// Decrement self by 1, and return the new value + /// Decrements `self` by 1, and returns the new value. #[inline(always)] unsafe fn pre_dec(&mut self) -> Self { *self = self.slice_offset(-1); @@ -1545,7 +1545,7 @@ impl<T> PointerExt for *mut T { /// splitn, splitn_mut etc can be implemented once. #[doc(hidden)] trait SplitIter: DoubleEndedIterator { - /// Mark the underlying iterator as complete, extracting the remaining + /// Marks the underlying iterator as complete, extracting the remaining /// portion of the slice. fn finish(&mut self) -> Option<Self::Item>; } @@ -2267,11 +2267,11 @@ pub fn heapsort<T, F>(v: &mut [T], mut is_less: F) // extern { - /// Call implementation provided memcmp + /// Calls implementation provided memcmp. /// /// Interprets the data as u8. /// - /// Return 0 for equal, < 0 for less than and > 0 for greater + /// Returns 0 for equal, < 0 for less than and > 0 for greater /// than. // FIXME(#32610): Return type should be c_int fn memcmp(s1: *const u8, s2: *const u8, n: usize) -> i32; diff --git a/src/libcore/slice/sort.rs b/src/libcore/slice/sort.rs index fdfba33f8a9..d13d537d993 100644 --- a/src/libcore/slice/sort.rs +++ b/src/libcore/slice/sort.rs @@ -104,7 +104,7 @@ fn shift_tail<T, F>(v: &mut [T], is_less: &mut F) /// Partially sorts a slice by shifting several out-of-order elements around. /// -/// Returns true if the slice is sorted at the end. This function is `O(n)` worst-case. +/// Returns `true` if the slice is sorted at the end. This function is `O(n)` worst-case. #[cold] fn partial_insertion_sort<T, F>(v: &mut [T], is_less: &mut F) -> bool where F: FnMut(&T, &T) -> bool @@ -528,7 +528,7 @@ fn break_patterns<T>(v: &mut [T]) { } } -/// Chooses a pivot in `v` and returns the index and true if the slice is likely already sorted. +/// Chooses a pivot in `v` and returns the index and `true` if the slice is likely already sorted. /// /// Elements in `v` might be reordered in the process. fn choose_pivot<T, F>(v: &mut [T], is_less: &mut F) -> (usize, bool) diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index cf3e8a684df..1efd8137fa3 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -343,13 +343,13 @@ pub struct Chars<'a> { iter: slice::Iter<'a, u8> } -/// Return the initial codepoint accumulator for the first byte. +/// Returns the initial codepoint accumulator for the first byte. /// The first byte is special, only want bottom 5 bits for width 2, 4 bits /// for width 3, and 3 bits for width 4. #[inline] fn utf8_first_byte(byte: u8, width: u32) -> u32 { (byte & (0x7F >> width)) as u32 } -/// Return the value of `ch` updated with continuation byte `byte`. +/// Returns the value of `ch` updated with continuation byte `byte`. #[inline] fn utf8_acc_cont_byte(ch: u32, byte: u8) -> u32 { (ch << 6) | (byte & CONT_MASK) as u32 } @@ -1244,13 +1244,13 @@ Section: UTF-8 validation // use truncation to fit u64 into usize const NONASCII_MASK: usize = 0x80808080_80808080u64 as usize; -/// Return `true` if any byte in the word `x` is nonascii (>= 128). +/// Returns `true` if any byte in the word `x` is nonascii (>= 128). #[inline] fn contains_nonascii(x: usize) -> bool { (x & NONASCII_MASK) != 0 } -/// Walk through `iter` checking that it's a valid UTF-8 sequence, +/// Walks through `iter` checking that it's a valid UTF-8 sequence, /// returning `true` in that case, or, if it is invalid, `false` with /// `iter` reset such that it is pointing at the first byte in the /// invalid sequence. @@ -1389,16 +1389,16 @@ static UTF8_CHAR_WIDTH: [u8; 256] = [ 4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0, // 0xFF ]; -/// Given a first byte, determine how many bytes are in this UTF-8 character +/// Given a first byte, determines how many bytes are in this UTF-8 character. #[unstable(feature = "str_internals", issue = "0")] #[inline] pub fn utf8_char_width(b: u8) -> usize { return UTF8_CHAR_WIDTH[b as usize] as usize; } -/// Mask of the value bits of a continuation byte +/// Mask of the value bits of a continuation byte. const CONT_MASK: u8 = 0b0011_1111; -/// Value of the tag bits (tag mask is !CONT_MASK) of a continuation byte +/// Value of the tag bits (tag mask is !CONT_MASK) of a continuation byte. const TAG_CONT_U8: u8 = 0b1000_0000; /* |
