Chris Morgan
›
Git
›
anymap
› blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
commit
grep
author
committer
pickaxe
?
search:
re
Add the BlueOak-1.0.0 license
[anymap]
/
src
/
raw.rs
diff --git
a/src/raw.rs
b/src/raw.rs
index 7d537832e424fef9862570295188644663260743..07dccf8d248ab7f7655b07af79d918a245f02f35 100644
(file)
--- a/
src/raw.rs
+++ b/
src/raw.rs
@@
-7,6
+7,7
@@
use std::borrow::Borrow;
use std::collections::hash_map::{self, HashMap};
use std::hash::Hash;
use std::hash::{Hasher, BuildHasherDefault};
use std::collections::hash_map::{self, HashMap};
use std::hash::Hash;
use std::hash::{Hasher, BuildHasherDefault};
+#[cfg(test)]
use std::mem;
use std::ops::{Index, IndexMut};
use std::ptr;
use std::mem;
use std::ops::{Index, IndexMut};
use std::ptr;
@@
-24,7
+25,7
@@
impl Hasher for TypeIdHasher {
// This expects to receive one and exactly one 64-bit value
debug_assert!(bytes.len() == 8);
unsafe {
// This expects to receive one and exactly one 64-bit value
debug_assert!(bytes.len() == 8);
unsafe {
- ptr::copy_nonoverlapping(
mem::transmute(&bytes[0])
, &mut self.value, 1)
+ ptr::copy_nonoverlapping(
&bytes[0] as *const u8 as *const u64
, &mut self.value, 1)
}
}
}
}
@@
-69,13
+70,6
@@
impl<A: ?Sized + UncheckedAnyExt> Clone for RawMap<A> where Box<A>: Clone {
}
}
}
}
-impl<A: ?Sized + UncheckedAnyExt> Default for RawMap<A> {
- #[inline]
- fn default() -> RawMap<A> {
- RawMap::new()
- }
-}
-
impl_common_methods! {
field: RawMap.inner;
new() => HashMap::with_hasher(Default::default());
impl_common_methods! {
field: RawMap.inner;
new() => HashMap::with_hasher(Default::default());