Use a 2-byte buffer for writing an i16

This commit is contained in:
Ryan Leckey 2019-09-02 16:52:06 -07:00
parent 5c5d027bf9
commit 1b7e7c2729

View File

@ -41,7 +41,7 @@ impl BufMut for Vec<u8> {
}
fn put_i16<T: ByteOrder>(&mut self, val: i16) {
let mut buf = [0; 4];
let mut buf = [0; 2];
T::write_i16(&mut buf, val);
self.extend_from_slice(&buf);
}