diff --git a/planning/rkyv-migration2/src/buffer.rs b/planning/rkyv-migration2/src/buffer.rs index 779166b14..b18298dfc 100644 --- a/planning/rkyv-migration2/src/buffer.rs +++ b/planning/rkyv-migration2/src/buffer.rs @@ -66,7 +66,7 @@ pub fn send_message(connection: CID, mut message: Message) -> core::result::Resu // emulated TextView let mut buffer = unsafe { Buffer::from_memory_message_mut(msg.body.memory_message_mut().unwrap()) }; - let mut tv = buffer.to_original::().unwrap(); + let mut tv = buffer.to_original::().unwrap(); println!("MSG: TextView"); println!("Contents: {:?}", tv); @@ -218,15 +218,14 @@ impl<'buf> Buffer<'buf> { self.replace_inner::(src) } - pub fn to_original(&self) -> core::result::Result + pub fn to_original(&self) -> core::result::Result where T: rkyv::Archive, U: Portable, - E: std::fmt::Debug, - ::Archived: Deserialize>, + ::Archived: Deserialize>, { let r = unsafe { rkyv::access_unchecked::(&self.slice[..self.used]) }; - Ok(rkyv::deserialize::(r).unwrap()) + Ok(rkyv::deserialize::(r).unwrap()) } pub fn as_flat(&self) -> core::result::Result<&U, ()> diff --git a/planning/rkyv-migration2/src/main.rs b/planning/rkyv-migration2/src/main.rs index a3a7a4bdd..ba367f92d 100644 --- a/planning/rkyv-migration2/src/main.rs +++ b/planning/rkyv-migration2/src/main.rs @@ -37,7 +37,7 @@ fn main() { let f = buf.as_flat::().unwrap(); println!("f: {:?}", f); - let t1 = buf.to_original::().unwrap(); + let t1 = buf.to_original::().unwrap(); println!("t copy 1: {:?}", t1); println!("buf.slice: {:x?}", &buf[..buf.used()]); @@ -74,7 +74,7 @@ fn main() { match tv_buf.lend_mut(1, 1) { Ok(r) => { println!("Returned {:?}", r); - let mut tv_orig = tv_buf.to_original::().unwrap(); + let mut tv_orig = tv_buf.to_original::().unwrap(); println!("bounds_computed: {:?}", tv_orig.bounds_computed); assert_eq!(tv_orig.bounds_computed.unwrap().tl.x, 42); assert_eq!(tv_orig.bounds_computed.unwrap().tl.y, 42); diff --git a/planning/rkyv-migration2/src/testcases.rs b/planning/rkyv-migration2/src/testcases.rs index 5f00f77b8..6465deb72 100644 --- a/planning/rkyv-migration2/src/testcases.rs +++ b/planning/rkyv-migration2/src/testcases.rs @@ -205,7 +205,7 @@ pub fn draw_textview(conn: xous::CID, tv: &mut TextView) -> Result<(), xous::Err let mut buf = crate::Buffer::into_buf(tv); buf.lend_mut(conn, Opcode::DrawTextView.to_u32().unwrap()).or(Err(xous::Error::InternalError))?; - let tvr = buf.to_original::().unwrap(); + let tvr = buf.to_original::().unwrap(); tv.bounds_computed = tvr.bounds_computed; tv.cursor = tvr.cursor; tv.overflow = tvr.overflow;