Stop using deprecated bytes APIs in tests (#324) (#331)

This commit is contained in:
Roman
2018-04-30 10:02:48 -07:00
committed by Carl Lerche
parent 9aaa8f06d1
commit d1d4fe4d07
2 changed files with 4 additions and 5 deletions
+2 -3
View File
@@ -21,7 +21,7 @@ impl Decoder for U32Codec {
return Ok(None);
}
let n = buf.split_to(4).into_buf().get_u32::<BigEndian>();
let n = buf.split_to(4).into_buf().get_u32_be();
Ok(Some(n))
}
}
@@ -33,7 +33,7 @@ impl Encoder for U32Codec {
fn encode(&mut self, item: u32, dst: &mut BytesMut) -> io::Result<()> {
// Reserve space
dst.reserve(4);
dst.put_u32::<BigEndian>(item);
dst.put_u32_be(item);
Ok(())
}
}
@@ -94,4 +94,3 @@ fn external_buf_does_not_shrink() {
assert_eq!(readbuf.capacity(), INITIAL_CAPACITY * 2);
}