about summary refs log tree commit diff
path: root/src/librustc_data_structures/sharded.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc_data_structures/sharded.rs')
-rw-r--r--src/librustc_data_structures/sharded.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_data_structures/sharded.rs b/src/librustc_data_structures/sharded.rs
index 15d1e2dd0b6..485719c5175 100644
--- a/src/librustc_data_structures/sharded.rs
+++ b/src/librustc_data_structures/sharded.rs
@@ -13,7 +13,7 @@ struct CacheAligned<T>(T);
 #[cfg(parallel_compiler)]
 // 32 shards is sufficient to reduce contention on an 8-core Ryzen 7 1700,
 // but this should be tested on higher core count CPUs. How the `Sharded` type gets used
-// may also affect the ideal nunber of shards.
+// may also affect the ideal number of shards.
 const SHARD_BITS: usize = 5;
 
 #[cfg(not(parallel_compiler))]
@@ -30,7 +30,7 @@ pub struct Sharded<T> {
 impl<T: Default> Default for Sharded<T> {
     #[inline]
     fn default() -> Self {
-        Self::new(|| T::default())
+        Self::new(T::default)
     }
 }
 
@@ -41,7 +41,7 @@ impl<T> Sharded<T> {
         let mut values: SmallVec<[_; SHARDS]> =
             (0..SHARDS).map(|_| CacheAligned(Lock::new(value()))).collect();
 
-        // Create an unintialized array
+        // Create an uninitialized array
         let mut shards: mem::MaybeUninit<[CacheAligned<Lock<T>>; SHARDS]> =
             mem::MaybeUninit::uninit();