Unverified Commit 3d53e740 authored by Zelda Hessler's avatar Zelda Hessler Committed by GitHub
Browse files

update: `From<hyper::Body>` for `ByteStream` now delegates to `SdkBody::from` (#1585)

* update: From<hyper::Body> for ByteStream now delegates to SdkBody::from
* add: comments to SdkBody inner enum variants
parent 852c2ec2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -55,13 +55,16 @@ pub type BoxBody = http_body::combinators::BoxBody<Bytes, Error>;
pin_project! {
    #[project = InnerProj]
    enum Inner {
        // An in-memory body
        Once {
            inner: Option<Bytes>
        },
        // A streaming body
        Streaming {
            #[pin]
            inner: hyper::Body
        },
        // Also a streaming body
        Dyn {
            #[pin]
            inner: BoxBody
+1 −3
Original line number Diff line number Diff line
@@ -441,9 +441,7 @@ impl From<Vec<u8>> for ByteStream {

impl From<hyper::Body> for ByteStream {
    fn from(input: hyper::Body) -> Self {
        ByteStream::new(SdkBody::from_dyn(
            input.map_err(|e| e.into_cause().unwrap()).boxed(),
        ))
        ByteStream::new(SdkBody::from(input))
    }
}