Implement Hash for Dynamic.

This commit is contained in:
Stephen Chung
2020-11-12 21:53:26 +08:00
parent 41c815f355
commit 8e5a53bc0d
2 changed files with 35 additions and 0 deletions

View File

@@ -836,6 +836,7 @@ pub struct FloatWrapper(pub FLOAT);
impl Hash for FloatWrapper {
#[inline(always)]
fn hash<H: Hasher>(&self, state: &mut H) {
TypeId::of::<FLOAT>().hash(state);
state.write(&self.0.to_le_bytes());
}
}