Return impl AsyncBufRead from into_async_read (#3164)
## Motivation and Context The tokio `StreamReader` implements `AsyncBufRead`, but we're returning `AsyncRead` currently. If a user needs an `AsyncBufRead`, then they've to wrap the returned value in tokio `BufReader` for no reason. Since `ByteStream` doesn't implement `Stream` anymore, one has to either wrap the returned value unnecessarily or write a wrapper similar to this function. See https://github.com/smithy-lang/smithy-rs/pull/2983#discussion_r1380822997 . ## Description Simply changed the return type to say `impl AsyncBufRead`. Since `AsyncBufRead` is a super-set of `AsyncRead`, this is not a breaking change. ## Testing The code example tests it. ## Checklist - [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by:Russell Cohen <rcoh@amazon.com>
Loading
Please register or sign in to comment