X-Git-Url: https://git.chrismorgan.info/anymap/blobdiff_plain/b549457d628fb178f6d700d85800f3ab63482d63..8ebb2d7e04d86d09614f578342e4765276372e7b:/src/raw.rs diff --git a/src/raw.rs b/src/raw.rs index 7d53783..07dccf8 100644 --- 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}; +#[cfg(test)] 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 { - 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 Clone for RawMap where Box: Clone { } } -impl Default for RawMap { - #[inline] - fn default() -> RawMap { - RawMap::new() - } -} - impl_common_methods! { field: RawMap.inner; new() => HashMap::with_hasher(Default::default());