From f30128d3a14a4462e8234ea62070b6f148b73bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20M=2E=20Bezerra?= Date: Thu, 23 Mar 2023 11:39:23 -0300 Subject: [PATCH] review 1: talk about using BufReader to change the capacity --- tokio/src/io/util/copy.rs | 8 +++++--- tokio/src/io/util/copy_buf.rs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tokio/src/io/util/copy.rs b/tokio/src/io/util/copy.rs index 0a84524caea..a5634bb7e68 100644 --- a/tokio/src/io/util/copy.rs +++ b/tokio/src/io/util/copy.rs @@ -160,13 +160,15 @@ cfg_io_util! { /// /// This is an asynchronous version of [`std::io::copy`][std]. /// - /// A heap-allocated buffer with 8 KB is created to take data from the - /// reader to the writer, check [`copy_buf`] if you want an alternative - /// for [`AsyncBufRead`]. + /// A heap-allocated copy buffer with 8 KB is created to take data from the + /// reader to the writer, check [`copy_buf`] if you want an alternative for + /// [`AsyncBufRead`], you can use it with [`BufReader`] to change the copy + /// buffer capacity. /// /// [std]: std::io::copy /// [`copy_buf`]: crate::io::copy_buf /// [`AsyncBufRead`]: crate::io::AsyncBufRead + /// [`BufReader`]: crate::io::BufReader /// /// # Errors /// diff --git a/tokio/src/io/util/copy_buf.rs b/tokio/src/io/util/copy_buf.rs index 9060f85c203..c23fc9a2b4c 100644 --- a/tokio/src/io/util/copy_buf.rs +++ b/tokio/src/io/util/copy_buf.rs @@ -29,7 +29,7 @@ cfg_io_util! { /// On success, the total number of bytes that were copied from `reader` to /// `writer` is returned. /// - /// This is a [`tokio::io::copy`] alternative for [`AsyncBufRead`] readers, + /// This is a [`tokio::io::copy`] alternative for [`AsyncBufRead`] readers /// with no extra buffer allocation, since [`AsyncBufRead`] allow access /// to the reader's inner buffer. ///