Skip to content

Commit

Permalink
review 1: talk about using BufReader to change the capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospb19 committed Mar 23, 2023
1 parent 4a4ecfa commit f30128d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions tokio/src/io/util/copy.rs
Expand Up @@ -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
///
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/io/util/copy_buf.rs
Expand Up @@ -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.
///
Expand Down

0 comments on commit f30128d

Please sign in to comment.