]> git.lizzy.rs Git - rust.git/commitdiff
Fixed several typos in libcollections
authorAlex Gaynor <alex.gaynor@gmail.com>
Sun, 16 Nov 2014 16:28:13 +0000 (08:28 -0800)
committerAlex Gaynor <alex.gaynor@gmail.com>
Sun, 16 Nov 2014 16:28:13 +0000 (08:28 -0800)
src/libcollections/bit.rs
src/libcollections/btree/map.rs
src/libcollections/btree/node.rs
src/libcollections/string.rs
src/libcollections/trie/map.rs

index f44f700ae5e422ffdc150c88a4a065cfb9bfd020..c0e37f7157a20498aaff3abd42f11027b87ee5ce 100644 (file)
@@ -283,7 +283,7 @@ pub fn get(&self, i: uint) -> bool {
         x != 0
     }
 
-    /// Sets the value of a bit at a index `i`.
+    /// Sets the value of a bit at an index `i`.
     ///
     /// # Panics
     ///
@@ -582,7 +582,7 @@ pub fn to_bools(&self) -> Vec<bool> {
     ///
     /// # Panics
     ///
-    /// Panics if the the `Bitv` and slice are of different length.
+    /// Panics if the `Bitv` and slice are of different length.
     ///
     /// # Example
     ///
index 57ca585f15e7b5c22b4244958240d8102ae2e7f9..93bcf49961b62e1f5aaa1c2dcd707596b8a27d4a 100644 (file)
@@ -53,7 +53,7 @@
 /// and possibly other factors. Using linear search, searching for a random element is expected
 /// to take O(B log<sub>B</sub>n) comparisons, which is generally worse than a BST. In practice,
 /// however, performance is excellent. `BTreeMap` is able to readily outperform `TreeMap` under
-/// many workloads, and is competetive where it doesn't. BTreeMap also generally *scales* better
+/// many workloads, and is competitive where it doesn't. BTreeMap also generally *scales* better
 /// than TreeMap, making it more appropriate for large datasets.
 ///
 /// However, `TreeMap` may still be more appropriate to use in many contexts. If elements are very
index a15d31ba2842abd044225644b377c21383637b2d..378657b93cb89f6564dfd417f39fe4188d39d2dc 100644 (file)
@@ -43,7 +43,7 @@ pub struct Node<K, V> {
     // theory, if we take full control of allocation like HashMap's RawTable does,
     // and restrict leaves to max size 256 (not unreasonable for a btree node) we can cut
     // this down to just (ptr, cap: u8, size: u8, is_leaf: bool). With generic
-    // integer arguments, cap can even move into the the type, reducing this just to
+    // integer arguments, cap can even move into the type, reducing this just to
     // (ptr, size, is_leaf). This could also have cache benefits for very small nodes, as keys
     // could bleed into edges and vals.
     //
index 3c75198a368bffa4a72c02b9d19d3219d12785b4..5866c067b2dfe9e2eaaf3645bc7af01b39e6605c 100644 (file)
@@ -549,7 +549,7 @@ pub fn pop(&mut self) -> Option<char> {
     ///
     /// # Warning
     ///
-    /// This is a O(n) operation as it requires copying every element in the
+    /// This is an O(n) operation as it requires copying every element in the
     /// buffer.
     ///
     /// # Panics
@@ -586,7 +586,7 @@ pub fn remove(&mut self, idx: uint) -> Option<char> {
     ///
     /// # Warning
     ///
-    /// This is a O(n) operation as it requires copying every element in the
+    /// This is an O(n) operation as it requires copying every element in the
     /// buffer.
     ///
     /// # Panics
index da53b5e9166ab00e23a74e860211f4231659be3a..93ed0b04616347153161d37bf492be275bff9ae9 100644 (file)
@@ -1056,7 +1056,7 @@ pub fn set(self, value: T) -> &'a mut T {
             search_stack.map.root.count = temp;
             value_ref
         }
-        // Otherwise, find the predeccessor of the last stack node, and insert as normal.
+        // Otherwise, find the predecessor of the last stack node, and insert as normal.
         else {
             match *search_stack.get_ref(old_length - 2) {
                 Internal(box ref mut parent) => {
@@ -1739,7 +1739,7 @@ fn test_vacant_entry_set() {
                     // Update it to i^3 using the returned mutable reference.
                     *inserted_val = i * i * i;
                 },
-                _ => panic!("Non-existant key found.")
+                _ => panic!("Non-existent key found.")
             }
             assert_eq!(map.get(&i).unwrap(), &(i * i * i));
         }