Skip to content

Commit 3b7a75b

Browse files
committed
update
1 parent 3a46841 commit 3b7a75b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/client/body/stream.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ impl Streamer {
8787
match frame {
8888
Ok(bytes) => Ok(Frame::Bytes(PyBuffer::from(bytes))),
8989
Err(Ok(trailers)) => Ok(Frame::Trailers(HeaderMap(trailers))),
90-
Err(Err(_)) => Err(error().into()),
90+
Err(Err(frame)) => {
91+
// This branch should be unreachable, as `http_body::Frame` can only be `Data` or `Trailers`.
92+
// The `debug_assert!` will help catch any future changes that violate this assumption.
93+
debug_assert!(false, "Unexpected frame type: {:?}", frame);
94+
Err(error().into())
95+
}
9196
}
9297
}
9398
}

0 commit comments

Comments
 (0)