From 1d287255f57a6d42a44035ceb9861e96dfc5ee55 Mon Sep 17 00:00:00 2001 From: Tom Kaitchuck Date: Thu, 15 Oct 2020 14:03:39 -0700 Subject: [PATCH 1/3] Change mention of `fnv` in HashMap to mention `aHash` as an alternitive hasher. Signed-off-by: Tom Kaitchuck --- library/std/src/collections/hash/map.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index 114707b639bce..0d8313c430e5f 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -35,7 +35,7 @@ use crate::sys; /// /// The hashing algorithm can be replaced on a per-`HashMap` basis using the /// [`default`], [`with_hasher`], and [`with_capacity_and_hasher`] methods. Many -/// alternative algorithms are available on crates.io, such as the [`fnv`] crate. +/// alternative algorithms are available on crates.io, such as the [`aHash`] crate. /// /// It is required that the keys implement the [`Eq`] and [`Hash`] traits, although /// this can frequently be achieved by using `#[derive(PartialEq, Eq, Hash)]`. @@ -154,7 +154,7 @@ use crate::sys; /// [`default`]: Default::default /// [`with_hasher`]: Self::with_hasher /// [`with_capacity_and_hasher`]: Self::with_capacity_and_hasher -/// [`fnv`]: https://crates.io/crates/fnv +/// [`aHash`]: https://crates.io/crates/ahash /// /// ``` /// use std::collections::HashMap; From 5b3d98d9f8d50a4bb3adf071dc6592cf458afbf1 Mon Sep 17 00:00:00 2001 From: Tom Kaitchuck Date: Tue, 27 Oct 2020 20:49:52 -0700 Subject: [PATCH 2/3] Change link to point to crates.io keyword "hasher" Signed-off-by: Tom Kaitchuck --- library/std/src/collections/hash/map.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index 0d8313c430e5f..03d8b11a51aef 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -34,8 +34,8 @@ use crate::sys; /// attacks such as HashDoS. /// /// The hashing algorithm can be replaced on a per-`HashMap` basis using the -/// [`default`], [`with_hasher`], and [`with_capacity_and_hasher`] methods. Many -/// alternative algorithms are available on crates.io, such as the [`aHash`] crate. +/// [`default`], [`with_hasher`], and [`with_capacity_and_hasher`] methods. +/// There are many alternative [hashing algorithms available on crates.io]. /// /// It is required that the keys implement the [`Eq`] and [`Hash`] traits, although /// this can frequently be achieved by using `#[derive(PartialEq, Eq, Hash)]`. @@ -57,6 +57,7 @@ use crate::sys; /// The original C++ version of SwissTable can be found [here], and this /// [CppCon talk] gives an overview of how the algorithm works. /// +/// [hashing algorithms available on crates.io]: https://crates.io/keywords/hasher /// [SwissTable]: https://abseil.io/blog/20180927-swisstables /// [here]: https://github.com/abseil/abseil-cpp/blob/master/absl/container/internal/raw_hash_set.h /// [CppCon talk]: https://www.youtube.com/watch?v=ncHmEUmJZf4 @@ -154,7 +155,6 @@ use crate::sys; /// [`default`]: Default::default /// [`with_hasher`]: Self::with_hasher /// [`with_capacity_and_hasher`]: Self::with_capacity_and_hasher -/// [`aHash`]: https://crates.io/crates/ahash /// /// ``` /// use std::collections::HashMap; From 4e5848349ce6f8b79dc9b2eba57e833431761bc7 Mon Sep 17 00:00:00 2001 From: Tom Kaitchuck Date: Thu, 12 Nov 2020 20:14:57 -0800 Subject: [PATCH 3/3] Update library/std/src/collections/hash/map.rs Co-authored-by: Mara Bos --- library/std/src/collections/hash/map.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index 03d8b11a51aef..c6a68a4467193 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -34,7 +34,7 @@ use crate::sys; /// attacks such as HashDoS. /// /// The hashing algorithm can be replaced on a per-`HashMap` basis using the -/// [`default`], [`with_hasher`], and [`with_capacity_and_hasher`] methods. +/// [`default`], [`with_hasher`], and [`with_capacity_and_hasher`] methods. /// There are many alternative [hashing algorithms available on crates.io]. /// /// It is required that the keys implement the [`Eq`] and [`Hash`] traits, although