Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: update http to 1.0 #96

Merged
merged 4 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion http-body-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ categories = ["web-programming"]
[dependencies]
bytes = "1"
futures-util = { version = "0.3.14", default-features = false, features = ["alloc"] }
http = "0.2"
http = "1"
http-body = { version = "=1.0.0-rc.2", path = "../http-body" }
pin-project-lite = "0.2"

Expand Down
2 changes: 1 addition & 1 deletion http-body-util/src/collected.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl<B: Buf> Collected<B> {

if let Ok(trailers) = frame.into_trailers() {
if let Some(current) = &mut self.trailers {
current.extend(trailers.into_iter());
current.extend(trailers);
} else {
self.trailers = Some(trailers);
}
Expand Down
4 changes: 1 addition & 3 deletions http-body-util/src/empty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ impl<D> Default for Empty<D> {

impl<D> Clone for Empty<D> {
fn clone(&self) -> Self {
Self {
_marker: PhantomData,
}
*self
}
}

Expand Down
4 changes: 2 additions & 2 deletions http-body-util/src/limited.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ mod tests {
hint.set_upper(0);
assert_eq!(body.size_hint().upper(), hint.upper());

assert!(matches!(body.frame().await, None));
assert!(body.frame().await.is_none());
}

#[tokio::test]
Expand Down Expand Up @@ -207,7 +207,7 @@ mod tests {
hint.set_upper(0);
assert_eq!(body.size_hint().upper(), hint.upper());

assert!(matches!(body.frame().await, None));
assert!(body.frame().await.is_none());
}

struct SomeTrailers;
Expand Down
2 changes: 1 addition & 1 deletion http-body/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ categories = ["web-programming"]

[dependencies]
bytes = "1"
http = "0.2"
http = "1"
4 changes: 4 additions & 0 deletions http-body/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ impl<B: Body> Body for http::Request<B> {
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>> {
// SAFETY:
// A pin projection.
unsafe {
self.map_unchecked_mut(http::Request::body_mut)
.poll_frame(cx)
Expand All @@ -164,6 +166,8 @@ impl<B: Body> Body for http::Response<B> {
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>> {
// SAFETY:
// A pin projection.
unsafe {
self.map_unchecked_mut(http::Response::body_mut)
.poll_frame(cx)
Expand Down