diff options
author | Jeff Vander Stoep <jeffv@google.com> | 2023-02-06 17:13:08 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-02-06 17:13:08 +0000 |
commit | 28aa86009a5eab4ba6d63844d34c5b4b41038203 (patch) | |
tree | d585fc992b047e0d1fb217f44c39d241d2c81c72 /src/io | |
parent | 6d9e152041be899074b952a8f0d1d5b1c73d2a05 (diff) | |
parent | 65647f91f23b1650e6783e09c178803ec888efb4 (diff) | |
download | tokio-28aa86009a5eab4ba6d63844d34c5b4b41038203.tar.gz |
Upgrade tokio to 1.25.0 am: a77df93fec am: 65647f91f2
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/tokio/+/2421506
Change-Id: I67638423614c339172fce0fa096cb3faf41af23c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'src/io')
-rw-r--r-- | src/io/blocking.rs | 2 | ||||
-rw-r--r-- | src/io/split.rs | 5 | ||||
-rw-r--r-- | src/io/stdio_common.rs | 3 | ||||
-rw-r--r-- | src/io/util/read.rs | 2 |
4 files changed, 7 insertions, 5 deletions
diff --git a/src/io/blocking.rs b/src/io/blocking.rs index f6db450..416573e 100644 --- a/src/io/blocking.rs +++ b/src/io/blocking.rs @@ -26,7 +26,7 @@ pub(crate) struct Buf { pos: usize, } -pub(crate) const MAX_BUF: usize = 16 * 1024; +pub(crate) const MAX_BUF: usize = 2 * 1024 * 1024; #[derive(Debug)] enum State<T> { diff --git a/src/io/split.rs b/src/io/split.rs index 2e0da95..f067b65 100644 --- a/src/io/split.rs +++ b/src/io/split.rs @@ -75,7 +75,10 @@ impl<T> ReadHalf<T> { /// This can be checked ahead of time by comparing the stream ID /// of the two halves. #[track_caller] - pub fn unsplit(self, wr: WriteHalf<T>) -> T { + pub fn unsplit(self, wr: WriteHalf<T>) -> T + where + T: Unpin, + { if self.is_pair_of(&wr) { drop(wr); diff --git a/src/io/stdio_common.rs b/src/io/stdio_common.rs index 2715ba7..b1cc61d 100644 --- a/src/io/stdio_common.rs +++ b/src/io/stdio_common.rs @@ -108,14 +108,13 @@ where #[cfg(test)] #[cfg(not(loom))] mod tests { + use crate::io::blocking::MAX_BUF; use crate::io::AsyncWriteExt; use std::io; use std::pin::Pin; use std::task::Context; use std::task::Poll; - const MAX_BUF: usize = 16 * 1024; - struct TextMockWriter; impl crate::io::AsyncWrite for TextMockWriter { diff --git a/src/io/util/read.rs b/src/io/util/read.rs index edc9d5a..a1f9c8a 100644 --- a/src/io/util/read.rs +++ b/src/io/util/read.rs @@ -48,7 +48,7 @@ where fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<usize>> { let me = self.project(); - let mut buf = ReadBuf::new(*me.buf); + let mut buf = ReadBuf::new(me.buf); ready!(Pin::new(me.reader).poll_read(cx, &mut buf))?; Poll::Ready(Ok(buf.filled().len())) } |