Skip to content

Commit

Permalink
refactor: use upstream http_body_util::BodyDataStream (#1514)
Browse files Browse the repository at this point in the history
Signed-off-by: tottoto <tottotodev@gmail.com>
  • Loading branch information
tottoto committed Jun 11, 2024
1 parent 5aa8f83 commit f8a8407
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ hashbrown = "0.14.0"
home = "0.5.4"
http = "1.1.0"
http-body = "1.0.0"
http-body-util = "0.1.1"
http-body-util = "0.1.2"
hyper = "1.2.0"
hyper-util = "0.1.3"
hyper-openssl = "0.10.2"
Expand Down
5 changes: 0 additions & 5 deletions kube-client/src/client/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ impl Body {
pub async fn collect_bytes(self) -> Result<Bytes, crate::Error> {
Ok(self.collect().await?.to_bytes())
}

// Convert this body into `Stream` which iterates only data frame skipping the other kind of frame
pub(crate) fn into_data_stream(self) -> impl Stream<Item = Result<Bytes, crate::Error>> {
Box::pin(BodyStream::new(self).try_filter_map(|frame| async { Ok(frame.into_data().ok()) }))
}
}

impl From<Bytes> for Body {
Expand Down

0 comments on commit f8a8407

Please sign in to comment.