summaryrefslogtreecommitdiffstats
path: root/tokio-io
diff options
context:
space:
mode:
authorRoman <humbug@deeptown.org>2018-04-30 20:02:48 +0300
committerCarl Lerche <me@carllerche.com>2018-04-30 10:02:48 -0700
commitd1d4fe4d0790a3d36e60104295165c4e2499def2 (patch)
treeae95bdd4835d5c346eabe67bedaa479ef1a4813e /tokio-io
parent9aaa8f06d1f03346fd682ab9d826b521d2efad5e (diff)
Stop using deprecated bytes APIs in tests (#324) (#331)
Diffstat (limited to 'tokio-io')
-rw-r--r--tokio-io/tests/framed.rs5
-rw-r--r--tokio-io/tests/framed_write.rs4
2 files changed, 4 insertions, 5 deletions
diff --git a/tokio-io/tests/framed.rs b/tokio-io/tests/framed.rs
index 7b2693be..660cc5d0 100644
--- a/tokio-io/tests/framed.rs
+++ b/tokio-io/tests/framed.rs
@@ -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);
}
-
diff --git a/tokio-io/tests/framed_write.rs b/tokio-io/tests/framed_write.rs
index 80160268..2db21b48 100644
--- a/tokio-io/tests/framed_write.rs
+++ b/tokio-io/tests/framed_write.rs
@@ -28,7 +28,7 @@ impl Encoder for U32Encoder {
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(())
}
}
@@ -65,7 +65,7 @@ fn write_hits_backpressure() {
for i in 0..(ITER + 1) {
let mut b = BytesMut::with_capacity(4);
- b.put_u32::<BigEndian>(i as u32);
+ b.put_u32_be(i as u32);
// Append to the end
match mock.calls.back_mut().unwrap() {