Skip to content

Commit e5b8e9e

Browse files
committed
accepting suggestion about header
1 parent 023c96a commit e5b8e9e

File tree

2 files changed

+49
-17
lines changed

2 files changed

+49
-17
lines changed

src/map.rs

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ impl<K, V> HashMap<K, V, DefaultHashBuilder> {
290290
/// The hash map is initially created with a capacity of 0, so it will not allocate until it
291291
/// is first inserted into.
292292
///
293-
/// Warning: `hash_builder` normally use a fixed key by default and that does
293+
/// # HashDoS resistance
294+
///
295+
/// The `hash_builder` normally use a fixed key by default and that does
294296
/// not allow the `HashMap` to be protected against attacks such as [`HashDoS`].
295297
/// Users who require HashDoS resistance should explicitly use
296298
/// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`]
@@ -318,7 +320,9 @@ impl<K, V> HashMap<K, V, DefaultHashBuilder> {
318320
/// The hash map will be able to hold at least `capacity` elements without
319321
/// reallocating. If `capacity` is 0, the hash map will not allocate.
320322
///
321-
/// Warning: `hash_builder` normally use a fixed key by default and that does
323+
/// # HashDoS resistance
324+
///
325+
/// The `hash_builder` normally use a fixed key by default and that does
322326
/// not allow the `HashMap` to be protected against attacks such as [`HashDoS`].
323327
/// Users who require HashDoS resistance should explicitly use
324328
/// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`]
@@ -349,7 +353,9 @@ impl<K, V, A: Allocator + Clone> HashMap<K, V, DefaultHashBuilder, A> {
349353
/// The hash map is initially created with a capacity of 0, so it will not allocate until it
350354
/// is first inserted into.
351355
///
352-
/// Warning: `hash_builder` normally use a fixed key by default and that does
356+
/// # HashDoS resistance
357+
///
358+
/// The `hash_builder` normally use a fixed key by default and that does
353359
/// not allow the `HashMap` to be protected against attacks such as [`HashDoS`].
354360
/// Users who require HashDoS resistance should explicitly use
355361
/// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`]
@@ -398,7 +404,9 @@ impl<K, V, A: Allocator + Clone> HashMap<K, V, DefaultHashBuilder, A> {
398404
/// The hash map will be able to hold at least `capacity` elements without
399405
/// reallocating. If `capacity` is 0, the hash map will not allocate.
400406
///
401-
/// Warning: `hash_builder` normally use a fixed key by default and that does
407+
/// # HashDoS resistance
408+
///
409+
/// The `hash_builder` normally use a fixed key by default and that does
402410
/// not allow the `HashMap` to be protected against attacks such as [`HashDoS`].
403411
/// Users who require HashDoS resistance should explicitly use
404412
/// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`]
@@ -455,7 +463,9 @@ impl<K, V, S> HashMap<K, V, S> {
455463
/// The hash map is initially created with a capacity of 0, so it will not
456464
/// allocate until it is first inserted into.
457465
///
458-
/// Warning: `hash_builder` normally use a fixed key by default and that does
466+
/// # HashDoS resistance
467+
///
468+
/// The `hash_builder` normally use a fixed key by default and that does
459469
/// not allow the `HashMap` to be protected against attacks such as [`HashDoS`].
460470
/// Users who require HashDoS resistance should explicitly use
461471
/// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`]
@@ -495,7 +505,9 @@ impl<K, V, S> HashMap<K, V, S> {
495505
/// The hash map will be able to hold at least `capacity` elements without
496506
/// reallocating. If `capacity` is 0, the hash map will not allocate.
497507
///
498-
/// Warning: `hash_builder` normally use a fixed key by default and that does
508+
/// # HashDoS resistance
509+
///
510+
/// The `hash_builder` normally use a fixed key by default and that does
499511
/// not allow the `HashMap` to be protected against attacks such as [`HashDoS`].
500512
/// Users who require HashDoS resistance should explicitly use
501513
/// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`]
@@ -543,7 +555,9 @@ impl<K, V, S, A: Allocator + Clone> HashMap<K, V, S, A> {
543555
/// The hash map is initially created with a capacity of 0, so it will not allocate until it
544556
/// is first inserted into.
545557
///
546-
/// Warning: `hash_builder` normally use a fixed key by default and that does
558+
/// # HashDoS resistance
559+
///
560+
/// The `hash_builder` normally use a fixed key by default and that does
547561
/// not allow the `HashMap` to be protected against attacks such as [`HashDoS`].
548562
/// Users who require HashDoS resistance should explicitly use
549563
/// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`]
@@ -576,7 +590,9 @@ impl<K, V, S, A: Allocator + Clone> HashMap<K, V, S, A> {
576590
/// The hash map will be able to hold at least `capacity` elements without
577591
/// reallocating. If `capacity` is 0, the hash map will not allocate.
578592
///
579-
/// Warning: `hash_builder` normally use a fixed key by default and that does
593+
/// # HashDoS resistance
594+
///
595+
/// The `hash_builder` normally use a fixed key by default and that does
580596
/// not allow the `HashMap` to be protected against attacks such as [`HashDoS`].
581597
/// Users who require HashDoS resistance should explicitly use
582598
/// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`]
@@ -6193,7 +6209,7 @@ impl<'a, 'b, K, Q: ?Sized, V, S, A: Allocator + Clone> OccupiedEntryRef<'a, 'b,
61936209
///
61946210
/// # Panics
61956211
///
6196-
/// Will panic if this OccupiedEntryRef was created through [`Entry::insert`].
6212+
/// Will panic if this OccupiedEntryRef was created through [`EntryRef::insert`].
61976213
///
61986214
/// # Examples
61996215
///

src/set.rs

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ impl<T> HashSet<T, DefaultHashBuilder> {
136136
/// The hash set is initially created with a capacity of 0, so it will not allocate until it
137137
/// is first inserted into.
138138
///
139-
/// Warning: `hash_builder` normally use a fixed key by default and that does
139+
/// # HashDoS resistance
140+
///
141+
/// The `hash_builder` normally use a fixed key by default and that does
140142
/// not allow the `HashSet` to be protected against attacks such as [`HashDoS`].
141143
/// Users who require HashDoS resistance should explicitly use
142144
/// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`]
@@ -164,7 +166,9 @@ impl<T> HashSet<T, DefaultHashBuilder> {
164166
/// The hash set will be able to hold at least `capacity` elements without
165167
/// reallocating. If `capacity` is 0, the hash set will not allocate.
166168
///
167-
/// Warning: `hash_builder` normally use a fixed key by default and that does
169+
/// # HashDoS resistance
170+
///
171+
/// The `hash_builder` normally use a fixed key by default and that does
168172
/// not allow the `HashSet` to be protected against attacks such as [`HashDoS`].
169173
/// Users who require HashDoS resistance should explicitly use
170174
/// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`]
@@ -196,7 +200,9 @@ impl<T: Hash + Eq, A: Allocator + Clone> HashSet<T, DefaultHashBuilder, A> {
196200
/// The hash set is initially created with a capacity of 0, so it will not allocate until it
197201
/// is first inserted into.
198202
///
199-
/// Warning: `hash_builder` normally use a fixed key by default and that does
203+
/// # HashDoS resistance
204+
///
205+
/// The `hash_builder` normally use a fixed key by default and that does
200206
/// not allow the `HashSet` to be protected against attacks such as [`HashDoS`].
201207
/// Users who require HashDoS resistance should explicitly use
202208
/// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`]
@@ -224,7 +230,9 @@ impl<T: Hash + Eq, A: Allocator + Clone> HashSet<T, DefaultHashBuilder, A> {
224230
/// The hash set will be able to hold at least `capacity` elements without
225231
/// reallocating. If `capacity` is 0, the hash set will not allocate.
226232
///
227-
/// Warning: `hash_builder` normally use a fixed key by default and that does
233+
/// # HashDoS resistance
234+
///
235+
/// The `hash_builder` normally use a fixed key by default and that does
228236
/// not allow the `HashSet` to be protected against attacks such as [`HashDoS`].
229237
/// Users who require HashDoS resistance should explicitly use
230238
/// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`]
@@ -430,7 +438,9 @@ impl<T, S> HashSet<T, S, Global> {
430438
/// The hash set is initially created with a capacity of 0, so it will not
431439
/// allocate until it is first inserted into.
432440
///
433-
/// Warning: `hash_builder` normally use a fixed key by default and that does
441+
/// # HashDoS resistance
442+
///
443+
/// The `hash_builder` normally use a fixed key by default and that does
434444
/// not allow the `HashSet` to be protected against attacks such as [`HashDoS`].
435445
/// Users who require HashDoS resistance should explicitly use
436446
/// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`]
@@ -466,7 +476,9 @@ impl<T, S> HashSet<T, S, Global> {
466476
/// The hash set will be able to hold at least `capacity` elements without
467477
/// reallocating. If `capacity` is 0, the hash set will not allocate.
468478
///
469-
/// Warning: `hash_builder` normally use a fixed key by default and that does
479+
/// # HashDoS resistance
480+
///
481+
/// The `hash_builder` normally use a fixed key by default and that does
470482
/// not allow the `HashSet` to be protected against attacks such as [`HashDoS`].
471483
/// Users who require HashDoS resistance should explicitly use
472484
/// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`]
@@ -513,7 +525,9 @@ where
513525
/// The hash set is initially created with a capacity of 0, so it will not
514526
/// allocate until it is first inserted into.
515527
///
516-
/// Warning: `hash_builder` normally use a fixed key by default and that does
528+
/// # HashDoS resistance
529+
///
530+
/// The `hash_builder` normally use a fixed key by default and that does
517531
/// not allow the `HashSet` to be protected against attacks such as [`HashDoS`].
518532
/// Users who require HashDoS resistance should explicitly use
519533
/// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`]
@@ -549,7 +563,9 @@ where
549563
/// The hash set will be able to hold at least `capacity` elements without
550564
/// reallocating. If `capacity` is 0, the hash set will not allocate.
551565
///
552-
/// Warning: `hash_builder` normally use a fixed key by default and that does
566+
/// # HashDoS resistance
567+
///
568+
/// The `hash_builder` normally use a fixed key by default and that does
553569
/// not allow the `HashSet` to be protected against attacks such as [`HashDoS`].
554570
/// Users who require HashDoS resistance should explicitly use
555571
/// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`]

0 commit comments

Comments
 (0)