diff options
| author | bors <bors@rust-lang.org> | 2018-12-08 03:50:16 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-12-08 03:50:16 +0000 |
| commit | 059e6a6f57f4e80d527a3cd8a8afe7f51f01af8e (patch) | |
| tree | 90e0d7a855be8202279b6bdde6cbdc95d834f07a /src/liballoc | |
| parent | 0a7798079608b4ff014471ae64b6c8201aa59cdf (diff) | |
| parent | 003c5b796eae78c8c260bfddfc332a69926a6152 (diff) | |
| download | rust-059e6a6f57f4e80d527a3cd8a8afe7f51f01af8e.tar.gz rust-059e6a6f57f4e80d527a3cd8a8afe7f51f01af8e.zip | |
Auto merge of #56578 - alexreg:cosmetic-1, r=alexreg
Various minor/cosmetic improvements to code r? @Centril 😄
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/boxed.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/collections/binary_heap.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/collections/btree/set.rs | 12 | ||||
| -rw-r--r-- | src/liballoc/raw_vec.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 4 | ||||
| -rw-r--r-- | src/liballoc/slice.rs | 10 | ||||
| -rw-r--r-- | src/liballoc/sync.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/tests/slice.rs | 6 | ||||
| -rw-r--r-- | src/liballoc/tests/str.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/vec.rs | 2 |
10 files changed, 22 insertions, 22 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index c3a84bf778d..83adcce5c74 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -801,7 +801,7 @@ impl<T: ?Sized> AsMut<T> for Box<T> { * safe.) * - It is in practice very useful to have Box<T> be unconditionally * Unpin because of trait objects, for which the structural auto - * trait functionality does not apply (e.g. Box<dyn Foo> would + * trait functionality does not apply (e.g., Box<dyn Foo> would * otherwise not be Unpin). * * Another type with the same semantics as Box but only a conditional diff --git a/src/liballoc/collections/binary_heap.rs b/src/liballoc/collections/binary_heap.rs index 8c36962a299..5dd0ea7d431 100644 --- a/src/liballoc/collections/binary_heap.rs +++ b/src/liballoc/collections/binary_heap.rs @@ -858,7 +858,7 @@ impl<T: Ord> BinaryHeap<T> { } } -/// Hole represents a hole in a slice i.e. an index without valid value +/// Hole represents a hole in a slice i.e., an index without valid value /// (because it was moved from or duplicated). /// In drop, `Hole` will restore the slice by filling the hole /// position with the value that was originally removed. diff --git a/src/liballoc/collections/btree/set.rs b/src/liballoc/collections/btree/set.rs index af9a7074e4a..fa74dce2f1f 100644 --- a/src/liballoc/collections/btree/set.rs +++ b/src/liballoc/collections/btree/set.rs @@ -258,7 +258,7 @@ impl<T: Ord> BTreeSet<T> { } /// Visits the values representing the difference, - /// i.e. the values that are in `self` but not in `other`, + /// i.e., the values that are in `self` but not in `other`, /// in ascending order. /// /// # Examples @@ -286,7 +286,7 @@ impl<T: Ord> BTreeSet<T> { } /// Visits the values representing the symmetric difference, - /// i.e. the values that are in `self` or in `other` but not in both, + /// i.e., the values that are in `self` or in `other` but not in both, /// in ascending order. /// /// # Examples @@ -316,7 +316,7 @@ impl<T: Ord> BTreeSet<T> { } /// Visits the values representing the intersection, - /// i.e. the values that are both in `self` and `other`, + /// i.e., the values that are both in `self` and `other`, /// in ascending order. /// /// # Examples @@ -344,7 +344,7 @@ impl<T: Ord> BTreeSet<T> { } /// Visits the values representing the union, - /// i.e. all the values in `self` or `other`, without duplicates, + /// i.e., all the values in `self` or `other`, without duplicates, /// in ascending order. /// /// # Examples @@ -455,7 +455,7 @@ impl<T: Ord> BTreeSet<T> { } /// Returns `true` if the set is a subset of another, - /// i.e. `other` contains at least all the values in `self`. + /// i.e., `other` contains at least all the values in `self`. /// /// # Examples /// @@ -498,7 +498,7 @@ impl<T: Ord> BTreeSet<T> { } /// Returns `true` if the set is a superset of another, - /// i.e. `self` contains at least all the values in `other`. + /// i.e., `self` contains at least all the values in `other`. /// /// # Examples /// diff --git a/src/liballoc/raw_vec.rs b/src/liballoc/raw_vec.rs index e87bf78561c..f4674b32769 100644 --- a/src/liballoc/raw_vec.rs +++ b/src/liballoc/raw_vec.rs @@ -739,7 +739,7 @@ unsafe impl<#[may_dangle] T, A: Alloc> Drop for RawVec<T, A> { // On 64-bit we just need to check for overflow since trying to allocate // `> isize::MAX` bytes will surely fail. On 32-bit and 16-bit we need to add // an extra guard for this in case we're running on a platform which can use -// all 4GB in user-space. e.g. PAE or x32 +// all 4GB in user-space. e.g., PAE or x32 #[inline] fn alloc_guard(alloc_size: usize) -> Result<(), CollectionAllocErr> { diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index c0a947e7011..52ad30c411a 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -276,7 +276,7 @@ struct RcBox<T: ?Sized> { /// See the [module-level documentation](./index.html) for more details. /// /// The inherent methods of `Rc` are all associated functions, which means -/// that you have to call them as e.g. [`Rc::get_mut(&mut value)`][get_mut] instead of +/// that you have to call them as e.g., [`Rc::get_mut(&mut value)`][get_mut] instead of /// `value.get_mut()`. This avoids conflicts with methods of the inner /// type `T`. /// @@ -1252,7 +1252,7 @@ impl<T: ?Sized> Weak<T> { } /// Return `None` when the pointer is dangling and there is no allocated `RcBox`, - /// i.e. this `Weak` was created by `Weak::new` + /// i.e., this `Weak` was created by `Weak::new` #[inline] fn inner(&self) -> Option<&RcBox<T>> { if is_dangling(self.ptr) { diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index 22da9dd6e96..a8e9a2f5a39 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -177,7 +177,7 @@ mod hack { impl<T> [T] { /// Sorts the slice. /// - /// This sort is stable (i.e. does not reorder equal elements) and `O(n log n)` worst-case. + /// This sort is stable (i.e., does not reorder equal elements) and `O(n log n)` worst-case. /// /// When applicable, unstable sorting is preferred because it is generally faster than stable /// sorting and it doesn't allocate auxiliary memory. @@ -211,7 +211,7 @@ impl<T> [T] { /// Sorts the slice with a comparator function. /// - /// This sort is stable (i.e. does not reorder equal elements) and `O(n log n)` worst-case. + /// This sort is stable (i.e., does not reorder equal elements) and `O(n log n)` worst-case. /// /// The comparator function must define a total ordering for the elements in the slice. If /// the ordering is not total, the order of the elements is unspecified. An order is a @@ -264,7 +264,7 @@ impl<T> [T] { /// Sorts the slice with a key extraction function. /// - /// This sort is stable (i.e. does not reorder equal elements) and `O(m n log(m n))` + /// This sort is stable (i.e., does not reorder equal elements) and `O(m n log(m n))` /// worst-case, where the key function is `O(m)`. /// /// When applicable, unstable sorting is preferred because it is generally faster than stable @@ -301,10 +301,10 @@ impl<T> [T] { /// /// During sorting, the key function is called only once per element. /// - /// This sort is stable (i.e. does not reorder equal elements) and `O(m n + n log n)` + /// This sort is stable (i.e., does not reorder equal elements) and `O(m n + n log n)` /// worst-case, where the key function is `O(m)`. /// - /// For simple key functions (e.g. functions that are property accesses or + /// For simple key functions (e.g., functions that are property accesses or /// basic operations), [`sort_by_key`](#method.sort_by_key) is likely to be /// faster. /// diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index 0a397f79103..111459d12a4 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -1121,7 +1121,7 @@ impl<T: ?Sized> Weak<T> { } /// Return `None` when the pointer is dangling and there is no allocated `ArcInner`, - /// i.e. this `Weak` was created by `Weak::new` + /// i.e., this `Weak` was created by `Weak::new` #[inline] fn inner(&self) -> Option<&ArcInner<T>> { if is_dangling(self.ptr) { diff --git a/src/liballoc/tests/slice.rs b/src/liballoc/tests/slice.rs index a50f99b0022..787e4952882 100644 --- a/src/liballoc/tests/slice.rs +++ b/src/liballoc/tests/slice.rs @@ -484,7 +484,7 @@ fn test_sort_stability() { // create a vector like [(6, 1), (5, 1), (6, 2), ...], // where the first item of each tuple is random, but // the second item represents which occurrence of that - // number this element is, i.e. the second elements + // number this element is, i.e., the second elements // will occur in sorted order. let mut orig: Vec<_> = (0..len) .map(|_| { @@ -502,7 +502,7 @@ fn test_sort_stability() { // This comparison includes the count (the second item // of the tuple), so elements with equal first items // will need to be ordered with increasing - // counts... i.e. exactly asserting that this sort is + // counts... i.e., exactly asserting that this sort is // stable. assert!(v.windows(2).all(|w| w[0] <= w[1])); @@ -1579,7 +1579,7 @@ macro_rules! test { }).join(); // Check that the number of things dropped is exactly - // what we expect (i.e. the contents of `v`). + // what we expect (i.e., the contents of `v`). for (i, c) in DROP_COUNTS.iter().enumerate().take(len) { let count = c.load(Relaxed); assert!(count == 1, diff --git a/src/liballoc/tests/str.rs b/src/liballoc/tests/str.rs index 494b36f8541..683ce2bf112 100644 --- a/src/liballoc/tests/str.rs +++ b/src/liballoc/tests/str.rs @@ -1005,7 +1005,7 @@ fn test_escape_debug() { // Note that there are subtleties with the number of backslashes // on the left- and right-hand sides. In particular, Unicode code points // are usually escaped with two backslashes on the right-hand side, as - // they are escaped. However, when the character is unescaped (e.g. for + // they are escaped. However, when the character is unescaped (e.g., for // printable characters), only a single backslash appears (as the character // itself appears in the debug string). assert_eq!("abc".escape_debug(), "abc"); diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index ca7c766e413..63af69dda1d 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -213,7 +213,7 @@ use raw_vec::RawVec; /// about its design. This ensures that it's as low-overhead as possible in /// the general case, and can be correctly manipulated in primitive ways /// by unsafe code. Note that these guarantees refer to an unqualified `Vec<T>`. -/// If additional type parameters are added (e.g. to support custom allocators), +/// If additional type parameters are added (e.g., to support custom allocators), /// overriding their defaults may change the behavior. /// /// Most fundamentally, `Vec` is and always will be a (pointer, capacity, length) |
