Skip to content

Commit

Permalink
Track latest nightly (rust-lang/rust#52963)
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Parkanyi committed Aug 20, 2018
1 parent 9f78546 commit 778db1b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn metro64s(t: &str) -> *const K {

// 128bit ops generate GUIDs
fn metro128s(t: &str) -> *const K {
let g = metro::hash128(&t).to_bytes();
let g = metro::hash128(&t).to_ne_bytes();

unsafe {
ku(U{ g })
Expand All @@ -72,7 +72,7 @@ fn metro128sb(t: &*const i8) -> *const K {
CStr::from_ptr(*t).to_bytes()
};

let g = metro::hash128(&bytes).to_bytes();
let g = metro::hash128(&bytes).to_ne_bytes();

unsafe {
ku(U{ g })
Expand All @@ -88,7 +88,7 @@ fn metro64sl(lt: &[*const i8]) -> *const K {
for t in lt.iter() {
let bytes = CStr::from_ptr(*t).to_bytes();

let g = metro::hash64(&bytes).to_bytes();
let g = metro::hash64(&bytes).to_ne_bytes();
std::ptr::copy_nonoverlapping(g.as_ptr(), kx.offset(i), g.len());

i += g.len() as isize;
Expand All @@ -107,7 +107,7 @@ fn metro128sl(lt: &[*const i8]) -> *const K {
for t in lt.iter() {
let bytes = CStr::from_ptr(*t).to_bytes();

let g = metro::hash128(&bytes).to_bytes();
let g = metro::hash128(&bytes).to_ne_bytes();
std::ptr::copy_nonoverlapping(g.as_ptr(), kx.offset(i), g.len());

i += g.len() as isize;
Expand All @@ -128,11 +128,11 @@ fn metro128ml(lt: &[KVal]) -> *const K {
for t in lt.iter() {
let res = match t {
KVal::String(s) => {
Some(metro::hash128(s).to_bytes())
Some(metro::hash128(s).to_ne_bytes())
}
KVal::Symbol(KData::Atom(s)) => {
let bytes = CStr::from_ptr(**s).to_bytes();
Some(metro::hash128(&bytes).to_bytes())
Some(metro::hash128(&bytes).to_ne_bytes())
}
_ => None
};
Expand Down Expand Up @@ -240,7 +240,7 @@ fn metro128kv(k: &KVal, v: &KVal) -> *const K {

if let Some(kv) = err { return kv; }

let g = hash.finish_ext().to_bytes();
let g = hash.finish_ext().to_ne_bytes();
unsafe {
ku(U{ g })
}
Expand Down

0 comments on commit 778db1b

Please sign in to comment.