diff --git a/src/lib.rs b/src/lib.rs index 786acf2..55fc6d1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -72,10 +72,10 @@ pub mod abomonated; /// ``` /// #[inline(always)] -pub unsafe fn encode(typed: &T, write: &mut W) -> IOResult<()> { +pub unsafe fn encode(typed: &T, mut write: W) -> IOResult<()> { let slice = std::slice::from_raw_parts(mem::transmute(typed), mem::size_of::()); write.write_all(slice)?; - typed.entomb(write) + typed.entomb(&mut write) } /// Decodes a mutable binary slice into an immutable typed reference.