diff --git a/src/protocols.rs b/src/protocols.rs index b8054c7..6ed046b 100644 --- a/src/protocols.rs +++ b/src/protocols.rs @@ -38,14 +38,14 @@ impl<'bytes> BinaryReadable<'bytes> for BString { impl BinaryWriteable for BString { type Item = ByteStr; - fn to_stream(stream: &mut Sink, item: &Self::Item, _: Endian) -> io::Result<()> + fn to_stream(stream: &mut Sink, item: &Self::Item, endian: Endian) -> io::Result<()> where Out: Write, { let len: Result = item.len().try_into(); match len { Ok(len) => { - stream.write_bytes(&len.to_ne_bytes())?; + stream.write(&len, endian)?; stream.write_bytes(item)?; Ok(()) } @@ -118,14 +118,14 @@ impl<'bytes> BinaryReadable<'bytes> for BZString { impl BinaryWriteable for BZString { type Item = ByteStr; - fn to_stream(stream: &mut Sink, item: &Self::Item, _: Endian) -> io::Result<()> + fn to_stream(stream: &mut Sink, item: &Self::Item, endian: Endian) -> io::Result<()> where Out: Write, { let len: Result = (item.len() + 1).try_into(); match len { Ok(len) => { - stream.write_bytes(&len.to_ne_bytes())?; + stream.write(&len, endian)?; stream.write_bytes(item)?; stream.write_bytes(b"\0")?; Ok(())