Skip to content

Commit a56fef8

Browse files
Rollup merge of rust-lang#42799 - leodasvacas:impl-clone-for-default-hasher, r=sfackler
Impl Clone for DefaultHasher It's useful for a hasher to be `Clone`. It's also strange for any type to not be `Clone`. `DefaultHasher` is not meant to be used directly, but being in std it can be useful as a placeholder. I don't see any forward compatibility hazard if the hasher is changed since it's very rare for something to not be `Clone`.
2 parents 03c8b92 + 6e628be commit a56fef8

File tree

1 file changed

+1
-1
lines changed
  • src/libstd/collections/hash

1 file changed

+1
-1
lines changed

src/libstd/collections/hash/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2384,7 +2384,7 @@ impl BuildHasher for RandomState {
23842384
/// [`Hasher`]: ../../hash/trait.Hasher.html
23852385
#[stable(feature = "hashmap_default_hasher", since = "1.13.0")]
23862386
#[allow(deprecated)]
2387-
#[derive(Debug)]
2387+
#[derive(Clone, Debug)]
23882388
pub struct DefaultHasher(SipHasher13);
23892389

23902390
impl DefaultHasher {

0 commit comments

Comments
 (0)