summaryrefslogtreecommitdiffstats
path: root/tokio-util
diff options
context:
space:
mode:
authorLucio Franco <luciofranco14@gmail.com>2020-10-12 12:41:40 -0400
committerGitHub <noreply@github.com>2020-10-12 12:41:40 -0400
commitf8c91f2ead24ed6e268a820405c329032dd30da6 (patch)
tree49df96ec1434bd5f253f1cec9422cadb1ca1be6a /tokio-util
parentb5750825431afe6fe227a6fcf30a593b51ceff1b (diff)
io: Rename `ReadBuf` methods (#2945)
This changes `ReadBuf::add_filled` to `ReadBuf::advance` and `ReadBuf::append` to `ReadBuf::put_slice`. This is just a mechanical change. Closes #2769
Diffstat (limited to 'tokio-util')
-rw-r--r--tokio-util/src/compat.rs2
-rw-r--r--tokio-util/src/io/stream_reader.rs2
-rw-r--r--tokio-util/tests/framed_read.rs2
-rw-r--r--tokio-util/tests/io_reader_stream.rs2
-rw-r--r--tokio-util/tests/length_delimited.rs2
5 files changed, 5 insertions, 5 deletions
diff --git a/tokio-util/src/compat.rs b/tokio-util/src/compat.rs
index 34120d43..f755c9b6 100644
--- a/tokio-util/src/compat.rs
+++ b/tokio-util/src/compat.rs
@@ -118,7 +118,7 @@ where
cx,
slice
))?;
- buf.add_filled(n);
+ buf.advance(n);
Poll::Ready(Ok(()))
}
}
diff --git a/tokio-util/src/io/stream_reader.rs b/tokio-util/src/io/stream_reader.rs
index def843b1..99079c73 100644
--- a/tokio-util/src/io/stream_reader.rs
+++ b/tokio-util/src/io/stream_reader.rs
@@ -114,7 +114,7 @@ where
Poll::Pending => return Poll::Pending,
};
let len = std::cmp::min(inner_buf.len(), buf.remaining());
- buf.append(&inner_buf[..len]);
+ buf.put_slice(&inner_buf[..len]);
self.consume(len);
Poll::Ready(Ok(()))
diff --git a/tokio-util/tests/framed_read.rs b/tokio-util/tests/framed_read.rs
index 52c30ef9..0ce8118e 100644
--- a/tokio-util/tests/framed_read.rs
+++ b/tokio-util/tests/framed_read.rs
@@ -271,7 +271,7 @@ impl AsyncRead for Mock {
match self.calls.pop_front() {
Some(Ok(data)) => {
debug_assert!(buf.remaining() >= data.len());
- buf.append(&data);
+ buf.put_slice(&data);
Ready(Ok(()))
}
Some(Err(ref e)) if e.kind() == WouldBlock => Pending,
diff --git a/tokio-util/tests/io_reader_stream.rs b/tokio-util/tests/io_reader_stream.rs
index b906de09..91986c8e 100644
--- a/tokio-util/tests/io_reader_stream.rs
+++ b/tokio-util/tests/io_reader_stream.rs
@@ -25,7 +25,7 @@ impl AsyncRead for Reader {
for x in &mut buf.initialize_unfilled_to(n)[..n] {
*x = 0;
}
- buf.add_filled(n);
+ buf.advance(n);
this.remaining -= n;
Poll::Ready(Ok(()))
} else {
diff --git a/tokio-util/tests/length_delimited.rs b/tokio-util/tests/length_delimited.rs
index 9f615412..126e41b5 100644
--- a/tokio-util/tests/length_delimited.rs
+++ b/tokio-util/tests/length_delimited.rs
@@ -712,7 +712,7 @@ impl AsyncRead for Mock {
match self.calls.pop_front() {
Some(Ready(Ok(Op::Data(data)))) => {
debug_assert!(dst.remaining() >= data.len());
- dst.append(&data);
+ dst.put_slice(&data);
Ready(Ok(()))
}
Some(Ready(Ok(_))) => panic!(),