From 6c5fe73ad9c95799aa7fd536b5ceca6dd78cb75e Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Mon, 7 Jun 2021 06:00:49 +0900 Subject: [PATCH] Fix typos (#101) --- src/lib.rs | 10 +++++----- src/serde.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index fa56777..38f18a5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -306,7 +306,7 @@ impl Slab { /// more values. /// /// `reserve_exact` does nothing if the slab already has sufficient capacity - /// for `additional` more valus. If more capacity is required, a new segment + /// for `additional` more values. If more capacity is required, a new segment /// of memory will be allocated and all existing values will be copied into /// it. As such, if the slab is already very large, a call to `reserve` can /// end up being expensive. @@ -493,7 +493,7 @@ impl Slab { // While there are vacant entries while guard.slab.entries.len() > guard.slab.len { // Find a value that needs to be moved, - // by popping entries until we find an occopied one. + // by popping entries until we find an occupied one. // (entries cannot be empty because 0 is not greater than anything) if let Some(Entry::Occupied(mut value)) = guard.slab.entries.pop() { // Found one, now find a vacant entry to move it to @@ -854,7 +854,7 @@ impl Slab { /// assert_eq!(slab.key_of(value), key); /// ``` /// - /// Values are not compared, so passing a reference to a different locaton + /// Values are not compared, so passing a reference to a different location /// will result in a panic: /// /// ```should_panic @@ -1190,7 +1190,7 @@ impl FromIterator<(usize, T)> for Slab { slab.len += 1; } // if an element with this key already exists, replace it. - // This is consisent with HashMap and BtreeMap + // This is consistent with HashMap and BtreeMap slab.entries[key] = Entry::Occupied(value); } else { // insert holes as necessary @@ -1205,7 +1205,7 @@ impl FromIterator<(usize, T)> for Slab { } } if slab.len == slab.entries.len() { - // no vacant enries, so next might not have been updated + // no vacant entries, so next might not have been updated slab.next = slab.entries.len(); } else if vacant_list_broken { slab.recreate_vacant_list(); diff --git a/src/serde.rs b/src/serde.rs index dd6ec90..fabeafc 100644 --- a/src/serde.rs +++ b/src/serde.rs @@ -51,7 +51,7 @@ where slab.len += 1; } // if an element with this key already exists, replace it. - // This is consisent with HashMap and BtreeMap + // This is consistent with HashMap and BtreeMap slab.entries[key] = Entry::Occupied(value); } else { // insert holes as necessary @@ -66,7 +66,7 @@ where } } if slab.len == slab.entries.len() { - // no vacant enries, so next might not have been updated + // no vacant entries, so next might not have been updated slab.next = slab.entries.len(); } else if vacant_list_broken { slab.recreate_vacant_list();