From 136ad015b6862274bf8c161dc5d2955409ed1465 Mon Sep 17 00:00:00 2001 From: Matthias Krüger Date: Fri, 6 Mar 2020 12:13:55 +0100 Subject: fix various typos --- src/liballoc/collections/btree/node.rs | 2 +- src/liballoc/collections/linked_list.rs | 6 +++--- src/liballoc/collections/vec_deque.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/liballoc/collections') diff --git a/src/liballoc/collections/btree/node.rs b/src/liballoc/collections/btree/node.rs index 362755f8b7f..edeb87a908d 100644 --- a/src/liballoc/collections/btree/node.rs +++ b/src/liballoc/collections/btree/node.rs @@ -306,7 +306,7 @@ impl Root { /// `NodeRef` could be pointing to either type of node. /// Note that in case of a leaf node, this might still be the shared root! /// Only turn this into a `LeafNode` reference if you know it is not the shared root! -/// Shared references must be dereferencable *for the entire size of their pointee*, +/// Shared references must be dereferenceable *for the entire size of their pointee*, /// so '&LeafNode` or `&InternalNode` pointing to the shared root is undefined behavior. /// Turning this into a `NodeHeader` reference is always safe. pub struct NodeRef { diff --git a/src/liballoc/collections/linked_list.rs b/src/liballoc/collections/linked_list.rs index a9b4e3e4706..e10d0db9d9a 100644 --- a/src/liballoc/collections/linked_list.rs +++ b/src/liballoc/collections/linked_list.rs @@ -841,10 +841,10 @@ impl LinkedList { /// d.push_front(2); /// d.push_front(3); /// - /// let mut splitted = d.split_off(2); + /// let mut split = d.split_off(2); /// - /// assert_eq!(splitted.pop_front(), Some(1)); - /// assert_eq!(splitted.pop_front(), None); + /// assert_eq!(split.pop_front(), Some(1)); + /// assert_eq!(split.pop_front(), None); /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn split_off(&mut self, at: usize) -> LinkedList { diff --git a/src/liballoc/collections/vec_deque.rs b/src/liballoc/collections/vec_deque.rs index 85d1d98b8a9..9d56f17700a 100644 --- a/src/liballoc/collections/vec_deque.rs +++ b/src/liballoc/collections/vec_deque.rs @@ -2132,7 +2132,7 @@ impl VecDeque { // Safety: the following two methods require that the rotation amount // be less than half the length of the deque. // - // `wrap_copy` requres that `min(x, cap() - x) + copy_len <= cap()`, + // `wrap_copy` requires that `min(x, cap() - x) + copy_len <= cap()`, // but than `min` is never more than half the capacity, regardless of x, // so it's sound to call here because we're calling with something // less than half the length, which is never above half the capacity. -- cgit 1.4.1-3-g733a5