Blob Blame History Raw
From 9aaa8f06d1f03346fd682ab9d826b521d2efad5e Mon Sep 17 00:00:00 2001
From: Carl Lerche <me@carllerche.com>
Date: Sat, 28 Apr 2018 12:25:22 -0700
Subject: [PATCH] Stop using deprecated bytes APIs (#324)

This also adds a filter for another treiber stack expected data race. The
race is expected as part of the algorithm.
---
 tokio-io/src/length_delimited.rs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tokio-io/src/length_delimited.rs b/tokio-io/src/length_delimited.rs
index 7e6635d1d9e9..b9f847622a37 100644
--- a/tokio-io/src/length_delimited.rs
+++ b/tokio-io/src/length_delimited.rs
@@ -1,6 +1,6 @@
 use {codec, AsyncRead, AsyncWrite};
 
-use bytes::{Buf, BufMut, BytesMut, IntoBuf, BigEndian, LittleEndian};
+use bytes::{Buf, BufMut, BytesMut, IntoBuf};
 use bytes::buf::Chain;
 
 use futures::{Async, AsyncSink, Stream, Sink, StartSend, Poll};
@@ -291,9 +291,9 @@ impl Decoder {
 
             // match endianess
             let n = if self.builder.length_field_is_big_endian {
-                src.get_uint::<BigEndian>(field_len)
+                src.get_uint_be(field_len)
             } else {
-                src.get_uint::<LittleEndian>(field_len)
+                src.get_uint_le(field_len)
             };
 
             if n > self.builder.max_frame_len as u64 {
@@ -479,9 +479,9 @@ impl<T: AsyncWrite, B: IntoBuf> FramedWrite<T, B> {
         };
 
         if self.builder.length_field_is_big_endian {
-            head.put_uint::<BigEndian>(n as u64, self.builder.length_field_len);
+            head.put_uint_be(n as u64, self.builder.length_field_len);
         } else {
-            head.put_uint::<LittleEndian>(n as u64, self.builder.length_field_len);
+            head.put_uint_le(n as u64, self.builder.length_field_len);
         }
 
         debug_assert!(self.frame.is_none());
-- 
2.17.0