Skip to content
Unverified Commit 7f8fef26 authored by Utkarsh Gupta's avatar Utkarsh Gupta Committed by GitHub
Browse files

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: default avatarRussell Cohen <rcoh@amazon.com>
parent 9a82b444
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment