diff --git a/CHANGELOG.next.toml b/CHANGELOG.next.toml index 79f95dc7184..6dbba7e62b0 100644 --- a/CHANGELOG.next.toml +++ b/CHANGELOG.next.toml @@ -17,6 +17,12 @@ references = ["smithy-rs#3126", "aws-sdk-rust#930"] meta = { "breaking" = false, "tada" = false, "bug" = true } author = "rcoh" +[[aws-sdk-rust]] +message = "Change `ByteStream::into_async_read` to return `AsyncBufRead`" +references = ["smithy-rs#3164"] +meta = { "breaking" = false, "tada" = false, "bug" = true } +author = "utkarshgupta137" + [[smithy-rs]] message = "The HTTP `Request`, `Response`, `Headers`, and `HeaderValue` types have been moved from `aws_smithy_runtime_api::client::http::*` into `aws_smithy_runtime_api::http`" references = ["smithy-rs#3138"] diff --git a/rust-runtime/aws-smithy-types/src/byte_stream.rs b/rust-runtime/aws-smithy-types/src/byte_stream.rs index ac4329b3edc..2aa26e3e9eb 100644 --- a/rust-runtime/aws-smithy-types/src/byte_stream.rs +++ b/rust-runtime/aws-smithy-types/src/byte_stream.rs @@ -428,18 +428,18 @@ impl ByteStream { /// # Example /// /// ```rust - /// use tokio::io::{BufReader, AsyncBufReadExt}; + /// use tokio::io::AsyncBufReadExt; /// use aws_smithy_types::byte_stream::ByteStream; /// /// # async fn dox(my_bytestream: ByteStream) -> std::io::Result<()> { - /// let mut lines = BufReader::new(my_bytestream.into_async_read()).lines(); + /// let mut lines = my_bytestream.into_async_read().lines(); /// while let Some(line) = lines.next_line().await? { /// // Do something line by line /// } /// # Ok(()) /// # } /// ``` - pub fn into_async_read(self) -> impl tokio::io::AsyncRead { + pub fn into_async_read(self) -> impl tokio::io::AsyncBufRead { // The `Stream` trait is currently unstable so we can only use it in private. // Here, we create a local struct just to enable the trait for `ByteStream` and pass it // to `StreamReader`.