Skip to content

Commit

Permalink
Rollup merge of rust-lang#42799 - leodasvacas:impl-clone-for-default-…
Browse files Browse the repository at this point in the history
…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`.
  • Loading branch information
frewsxcv authored Jun 22, 2017
2 parents a0fa5ab + 6e628be commit 195b4e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstd/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2384,7 +2384,7 @@ impl BuildHasher for RandomState {
/// [`Hasher`]: ../../hash/trait.Hasher.html
#[stable(feature = "hashmap_default_hasher", since = "1.13.0")]
#[allow(deprecated)]
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct DefaultHasher(SipHasher13);

impl DefaultHasher {
Expand Down

0 comments on commit 195b4e6

Please sign in to comment.