From: Ian Jackson Date: Sun, 28 Jun 2020 23:30:22 +0000 (+0100) Subject: make ids the way up that slotmap has them X-Git-Tag: otter-0.2.0~1498 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=5b9a92690d04075ed718df55b8c7376f6a0b975b;p=otter.git make ids the way up that slotmap has them --- diff --git a/src/keydata.rs b/src/keydata.rs index 78563de3..35889d22 100644 --- a/src/keydata.rs +++ b/src/keydata.rs @@ -22,8 +22,8 @@ pub use crate::display_consequential_impls; // this is madness! pub fn slotkey_parse(s : &str, sep : char) -> SKD { let e = || anyhow!("could not deserialise visibile piece id"); let mut i = s.splitn(2,sep).map(|s| s.parse().map_err(|_| e())); - let h : u32 = i.next().ok_or_else(e)??; let l : u32 = i.next().ok_or_else(e)??; + let h : u32 = i.next().ok_or_else(e)??; let v = ((h as u64) << 32) | (l as u64); SKD::from_ffi(v) } @@ -31,7 +31,7 @@ pub fn slotkey_parse(s : &str, sep : char) -> SKD { #[throws(fmt::Error)] pub fn slotkey_write(k : SKD, sep : char, f : &mut fmt::Formatter) { let v = k.as_ffi(); - write!(f, "{}{}{}", v >> 32, sep, v & 0xffffffff)? + write!(f, "{}{}{}", v & 0xffffffff, sep, v >> 32)? } #[macro_export]