Skip to content

Commit 53a54c7

Browse files
docs: Add missing backticks.
1 parent 0011336 commit 53a54c7

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

src/map.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ impl<K: Clone, V: Clone, S: Clone, A: Allocator + Clone> Clone for HashMap<K, V,
204204
}
205205

206206
/// Ensures that a single closure type across uses of this which, in turn prevents multiple
207-
/// instances of any functions like RawTable::reserve from being generated
207+
/// instances of any functions like `RawTable::reserve` from being generated
208208
#[cfg_attr(feature = "inline-more", inline)]
209209
pub(crate) fn make_hasher<Q, V, S>(hash_builder: &S) -> impl Fn(&(Q, V)) -> u64 + '_
210210
where
@@ -215,7 +215,7 @@ where
215215
}
216216

217217
/// Ensures that a single closure type across uses of this which, in turn prevents multiple
218-
/// instances of any functions like RawTable::reserve from being generated
218+
/// instances of any functions like `RawTable::reserve` from being generated
219219
#[cfg_attr(feature = "inline-more", inline)]
220220
pub(crate) fn equivalent_key<Q, K, V>(k: &Q) -> impl Fn(&(K, V)) -> bool + '_
221221
where
@@ -225,7 +225,7 @@ where
225225
}
226226

227227
/// Ensures that a single closure type across uses of this which, in turn prevents multiple
228-
/// instances of any functions like RawTable::reserve from being generated
228+
/// instances of any functions like `RawTable::reserve` from being generated
229229
#[cfg_attr(feature = "inline-more", inline)]
230230
#[allow(dead_code)]
231231
pub(crate) fn equivalent<Q, K>(k: &Q) -> impl Fn(&K) -> bool + '_
@@ -433,7 +433,7 @@ impl<K, V, S> HashMap<K, V, S> {
433433
/// as the hasher when creating a [`HashMap`].
434434
///
435435
/// The `hash_builder` passed should implement the [`BuildHasher`] trait for
436-
/// the HashMap to be useful, see its documentation for details.
436+
/// the `HashMap` to be useful, see its documentation for details.
437437
///
438438
/// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack
439439
/// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html
@@ -475,7 +475,7 @@ impl<K, V, S> HashMap<K, V, S> {
475475
/// as the hasher when creating a [`HashMap`].
476476
///
477477
/// The `hash_builder` passed should implement the [`BuildHasher`] trait for
478-
/// the HashMap to be useful, see its documentation for details.
478+
/// the `HashMap` to be useful, see its documentation for details.
479479
///
480480
/// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack
481481
/// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html
@@ -3774,7 +3774,7 @@ impl<'a, K, V, S, A: Allocator> OccupiedEntry<'a, K, V, S, A> {
37743774
unsafe { &mut self.elem.as_mut().1 }
37753775
}
37763776

3777-
/// Converts the OccupiedEntry into a mutable reference to the value in the entry
3777+
/// Converts the `OccupiedEntry` into a mutable reference to the value in the entry
37783778
/// with a lifetime bound to the map itself.
37793779
///
37803780
/// If you need multiple references to the `OccupiedEntry`, see [`get_mut`].
@@ -4270,7 +4270,7 @@ impl<'a, 'b, K, Q: ?Sized, V, S, A: Allocator> VacantEntryRef<'a, 'b, K, Q, V, S
42704270
self.key
42714271
}
42724272

4273-
/// Sets the value of the entry with the VacantEntryRef's key,
4273+
/// Sets the value of the entry with the `VacantEntryRef`'s key,
42744274
/// and returns a mutable reference to it.
42754275
///
42764276
/// # Examples

src/raw/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ fn bucket_mask_to_capacity(bucket_mask: usize) -> usize {
228228
}
229229
}
230230

231-
/// Helper which allows the max calculation for ctrl_align to be statically computed for each T
231+
/// Helper which allows the max calculation for `ctrl_align` to be statically computed for each `T`
232232
/// while keeping the rest of `calculate_layout_for` independent of `T`
233233
#[derive(Copy, Clone)]
234234
struct TableLayout {
@@ -2582,7 +2582,7 @@ impl RawTableInner {
25822582

25832583
/// Attempts to allocate a new hash table with at least enough capacity
25842584
/// for inserting the given number of elements without reallocating,
2585-
/// and return it inside ScopeGuard to protect against panic in the hash
2585+
/// and return it inside `ScopeGuard` to protect against panic in the hash
25862586
/// function.
25872587
///
25882588
/// # Note
@@ -3294,7 +3294,7 @@ impl<T: Copy, A: Allocator + Clone> RawTableClone for RawTable<T, A> {
32943294
}
32953295

32963296
impl<T: Clone, A: Allocator + Clone> RawTable<T, A> {
3297-
/// Common code for clone and clone_from. Assumes:
3297+
/// Common code for `clone` and `clone_from`. Assumes:
32983298
/// - `self.buckets() == source.buckets()`.
32993299
/// - Any existing elements have been dropped.
33003300
/// - The control bytes are not initialized yet.
@@ -3419,7 +3419,7 @@ impl<T> RawIterRange<T> {
34193419
///
34203420
/// * `ctrl` must be [valid] for reads, i.e. table outlives the `RawIterRange`;
34213421
///
3422-
/// * `ctrl` must be properly aligned to the group size (Group::WIDTH);
3422+
/// * `ctrl` must be properly aligned to the group size (`Group::WIDTH`);
34233423
///
34243424
/// * `ctrl` must point to the array of properly initialized control bytes;
34253425
///
@@ -3501,7 +3501,7 @@ impl<T> RawIterRange<T> {
35013501
}
35023502

35033503
/// # Safety
3504-
/// If DO_CHECK_PTR_RANGE is false, caller must ensure that we never try to iterate
3504+
/// If `DO_CHECK_PTR_RANGE` is false, caller must ensure that we never try to iterate
35053505
/// after yielding all elements.
35063506
#[cfg_attr(feature = "inline-more", inline)]
35073507
unsafe fn next_impl<const DO_CHECK_PTR_RANGE: bool>(&mut self) -> Option<Bucket<T>> {

src/raw_entry.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use core::hash::{BuildHasher, Hash};
66
use core::mem;
77

88
impl<K, V, S, A: Allocator> HashMap<K, V, S, A> {
9-
/// Creates a raw entry builder for the HashMap.
9+
/// Creates a raw entry builder for the `HashMap`.
1010
///
1111
/// Raw entries provide the lowest level of control for searching and
1212
/// manipulating a map. They must be manually initialized with a hash and
@@ -21,13 +21,13 @@ impl<K, V, S, A: Allocator> HashMap<K, V, S, A> {
2121
/// * Using custom comparison logic without newtype wrappers
2222
///
2323
/// Because raw entries provide much more low-level control, it's much easier
24-
/// to put the HashMap into an inconsistent state which, while memory-safe,
24+
/// to put the `HashMap` into an inconsistent state which, while memory-safe,
2525
/// will cause the map to produce seemingly random results. Higher-level and
2626
/// more foolproof APIs like `entry` should be preferred when possible.
2727
///
2828
/// In particular, the hash used to initialized the raw entry must still be
2929
/// consistent with the hash of the key that is ultimately stored in the entry.
30-
/// This is because implementations of HashMap may need to recompute hashes
30+
/// This is because implementations of `HashMap` may need to recompute hashes
3131
/// when resizing, at which point only the keys are available.
3232
///
3333
/// Raw entries give mutable access to the keys. This must not be used
@@ -108,7 +108,7 @@ impl<K, V, S, A: Allocator> HashMap<K, V, S, A> {
108108
RawEntryBuilderMut { map: self }
109109
}
110110

111-
/// Creates a raw immutable entry builder for the HashMap.
111+
/// Creates a raw immutable entry builder for the `HashMap`.
112112
///
113113
/// Raw entries provide the lowest level of control for searching and
114114
/// manipulating a map. They must be manually initialized with a hash and
@@ -708,7 +708,7 @@ impl<'a, K, V, S, A: Allocator> RawEntryBuilder<'a, K, V, S, A> {
708708
}
709709

710710
impl<'a, K, V, S, A: Allocator> RawEntryMut<'a, K, V, S, A> {
711-
/// Sets the value of the entry, and returns a RawOccupiedEntryMut.
711+
/// Sets the value of the entry, and returns a `RawOccupiedEntryMut`.
712712
///
713713
/// # Examples
714714
///
@@ -1005,7 +1005,7 @@ impl<'a, K, V, S, A: Allocator> RawOccupiedEntryMut<'a, K, V, S, A> {
10051005
unsafe { &self.elem.as_ref().1 }
10061006
}
10071007

1008-
/// Converts the OccupiedEntry into a mutable reference to the value in the entry
1008+
/// Converts the `OccupiedEntry` into a mutable reference to the value in the entry
10091009
/// with a lifetime bound to the map itself.
10101010
///
10111011
/// # Examples
@@ -1109,7 +1109,7 @@ impl<'a, K, V, S, A: Allocator> RawOccupiedEntryMut<'a, K, V, S, A> {
11091109
}
11101110
}
11111111

1112-
/// Converts the OccupiedEntry into a mutable reference to the key and value in the entry
1112+
/// Converts the `OccupiedEntry` into a mutable reference to the key and value in the entry
11131113
/// with a lifetime bound to the map itself.
11141114
///
11151115
/// # Examples
@@ -1301,7 +1301,7 @@ impl<'a, K, V, S, A: Allocator> RawOccupiedEntryMut<'a, K, V, S, A> {
13011301
}
13021302

13031303
impl<'a, K, V, S, A: Allocator> RawVacantEntryMut<'a, K, V, S, A> {
1304-
/// Sets the value of the entry with the VacantEntry's key,
1304+
/// Sets the value of the entry with the `VacantEntry`'s key,
13051305
/// and returns a mutable reference to it.
13061306
///
13071307
/// # Examples
@@ -1328,7 +1328,7 @@ impl<'a, K, V, S, A: Allocator> RawVacantEntryMut<'a, K, V, S, A> {
13281328
self.insert_hashed_nocheck(hash, key, value)
13291329
}
13301330

1331-
/// Sets the value of the entry with the VacantEntry's key,
1331+
/// Sets the value of the entry with the `VacantEntry`'s key,
13321332
/// and returns a mutable reference to it.
13331333
///
13341334
/// # Examples

src/set.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ impl<T, S> HashSet<T, S, Global> {
449449
/// as the hasher when creating a [`HashSet`].
450450
///
451451
/// The `hash_builder` passed should implement the [`BuildHasher`] trait for
452-
/// the HashSet to be useful, see its documentation for details.
452+
/// the `HashSet` to be useful, see its documentation for details.
453453
///
454454
/// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack
455455
/// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html
@@ -487,7 +487,7 @@ impl<T, S> HashSet<T, S, Global> {
487487
/// as the hasher when creating a [`HashSet`].
488488
///
489489
/// The `hash_builder` passed should implement the [`BuildHasher`] trait for
490-
/// the HashSet to be useful, see its documentation for details.
490+
/// the `HashSet` to be useful, see its documentation for details.
491491
///
492492
/// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack
493493
/// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html
@@ -536,7 +536,7 @@ where
536536
/// as the hasher when creating a [`HashSet`].
537537
///
538538
/// The `hash_builder` passed should implement the [`BuildHasher`] trait for
539-
/// the HashSet to be useful, see its documentation for details.
539+
/// the `HashSet` to be useful, see its documentation for details.
540540
///
541541
/// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack
542542
/// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html
@@ -574,7 +574,7 @@ where
574574
/// as the hasher when creating a [`HashSet`].
575575
///
576576
/// The `hash_builder` passed should implement the [`BuildHasher`] trait for
577-
/// the HashSet to be useful, see its documentation for details.
577+
/// the `HashSet` to be useful, see its documentation for details.
578578
///
579579
/// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack
580580
/// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html
@@ -2523,7 +2523,7 @@ impl<'a, T, S, A: Allocator> VacantEntry<'a, T, S, A> {
25232523
self.inner.into_key()
25242524
}
25252525

2526-
/// Sets the value of the entry with the VacantEntry's value.
2526+
/// Sets the value of the entry with the `VacantEntry`'s value.
25272527
///
25282528
/// # Examples
25292529
///

src/table.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,7 +1681,7 @@ where
16811681
unsafe { self.bucket.as_mut() }
16821682
}
16831683

1684-
/// Converts the OccupiedEntry into a mutable reference to the value in the entry
1684+
/// Converts the `OccupiedEntry` into a mutable reference to the value in the entry
16851685
/// with a lifetime bound to the table itself.
16861686
///
16871687
/// If you need multiple references to the `OccupiedEntry`, see [`get_mut`].
@@ -1732,7 +1732,7 @@ where
17321732
unsafe { self.bucket.as_mut() }
17331733
}
17341734

1735-
/// Converts the OccupiedEntry into a mutable reference to the underlying
1735+
/// Converts the `OccupiedEntry` into a mutable reference to the underlying
17361736
/// table.
17371737
pub fn into_table(self) -> &'a mut HashTable<T, A> {
17381738
self.table
@@ -1842,7 +1842,7 @@ where
18421842
}
18431843
}
18441844

1845-
/// Converts the VacantEntry into a mutable reference to the underlying
1845+
/// Converts the `VacantEntry` into a mutable reference to the underlying
18461846
/// table.
18471847
pub fn into_table(self) -> &'a mut HashTable<T, A> {
18481848
self.table
@@ -1907,7 +1907,7 @@ impl<'a, T, A> AbsentEntry<'a, T, A>
19071907
where
19081908
A: Allocator,
19091909
{
1910-
/// Converts the AbsentEntry into a mutable reference to the underlying
1910+
/// Converts the `AbsentEntry` into a mutable reference to the underlying
19111911
/// table.
19121912
pub fn into_table(self) -> &'a mut HashTable<T, A> {
19131913
self.table

0 commit comments

Comments
 (0)