Skip to content

Commit 7497d6e

Browse files
committed
Take writer by value
1 parent c389ead commit 7497d6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ pub mod abomonated;
7272
/// ```
7373
///
7474
#[inline(always)]
75-
pub unsafe fn encode<T: Abomonation, W: Write>(typed: &T, write: &mut W) -> IOResult<()> {
75+
pub unsafe fn encode<T: Abomonation, W: Write>(typed: &T, mut write: W) -> IOResult<()> {
7676
let slice = std::slice::from_raw_parts(mem::transmute(typed), mem::size_of::<T>());
7777
write.write_all(slice)?;
78-
typed.entomb(write)
78+
typed.entomb(&mut write)
7979
}
8080

8181
/// Decodes a mutable binary slice into an immutable typed reference.

0 commit comments

Comments
 (0)