Skip to content

Commit 4b35313

Browse files
committed
fix typo in hashmap and hashset try_reserve method
1 parent 33b55ac commit 4b35313

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

library/std/src/collections/hash/map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ where
759759

760760
/// Tries to reserve capacity for at least `additional` more elements to be inserted
761761
/// in the `HashMap`. The collection may reserve more space to speculatively
762-
/// avoid frequent reallocations. After calling `reserve`,
762+
/// avoid frequent reallocations. After calling `try_reserve`,
763763
/// capacity will be greater than or equal to `self.len() + additional` if
764764
/// it returns `Ok(())`.
765765
/// Does nothing if capacity is already sufficient.

library/std/src/collections/hash/set.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ where
462462

463463
/// Tries to reserve capacity for at least `additional` more elements to be inserted
464464
/// in the `HashSet`. The collection may reserve more space to speculatively
465-
/// avoid frequent reallocations. After calling `reserve`,
465+
/// avoid frequent reallocations. After calling `try_reserve`,
466466
/// capacity will be greater than or equal to `self.len() + additional` if
467467
/// it returns `Ok(())`.
468468
/// Does nothing if capacity is already sufficient.

0 commit comments

Comments
 (0)