Skip to content

Commit

Permalink
chore(deps): hyper v1.0.0-rc.4
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Jul 26, 2023
1 parent 8738d0b commit 38e7edc
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 14 deletions.
13 changes: 7 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ futures-util = { version = "0.3", default-features = false, features = [
anyhow = "1.0"
rand = "0.8"
async-fs = "1.6"
tempfile = "3.4"
hyper = { version = "1.0.0-rc.3", features = ["server", "http1"] }
http-body = "1.0.0-rc.2"
http-body-util = "0.1.0-rc.2"
tokio = { version = "1.27", features = ["macros", "rt-multi-thread"] }
tokio-util = { version = "0.7.7", features = ["io"] }
tempfile = "3.7"
hyper = { version = "=1.0.0-rc.4", features = ["server", "http1"] }
hyper-util = { version = "=0.0.0", git = "https://github.com/hyperium/hyper-util.git" }
http-body = "=1.0.0-rc.2"
http-body-util = "=0.1.0-rc.3"
tokio = { version = "1.29", features = ["macros", "rt-multi-thread"] }
tokio-util = { version = "0.7", features = ["io"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
warp = "0.3"
tiny_http = "0.12"
Expand Down
3 changes: 2 additions & 1 deletion examples/hyper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use futures_util::{
};
use http_body_util::Full;
use hyper::{body::Incoming, header, server::conn::http1, service::service_fn, Request, Response};
use hyper_util::rt::TokioIo;
use tempfile::tempdir;
use tokio::net::TcpListener;

Expand Down Expand Up @@ -156,7 +157,7 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
if let Err(err) = http1::Builder::new()
.max_buf_size(size)
.serve_connection(
stream,
TokioIo::new(stream),
service_fn(|req: Request<Incoming>| hello(size, req)),
)
.await
Expand Down
5 changes: 3 additions & 2 deletions src/async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ where
trace!("polling {} {}", self.index, self.state.is_some());

let Some(state) = self.state.clone() else {
return Poll::Ready(None)
return Poll::Ready(None);
};

let is_file = self.filename.is_some();
Expand Down Expand Up @@ -263,7 +263,8 @@ where
// invalid content disposition
let Some((name, filename)) = headers
.remove(CONTENT_DISPOSITION)
.and_then(|v| parse_content_disposition(v.as_bytes()).ok()) else {
.and_then(|v| parse_content_disposition(v.as_bytes()).ok())
else {
return Poll::Ready(Some(Err(Error::InvalidContentDisposition)));
};

Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
//! };
//! use http_body_util::Full;
//! use hyper::{body::Incoming, header, server::conn::http1, service::service_fn, Request, Response};
//! use hyper_util::rt::TokioIo;
//! use tempfile::tempdir;
//! use tokio::net::TcpListener;
//!
Expand Down Expand Up @@ -140,7 +141,7 @@
//! if let Err(err) = http1::Builder::new()
//! .max_buf_size(size)
//! .serve_connection(
//! stream,
//! TokioIo::new(stream),
//! service_fn(|req: Request<Incoming>| hello(size, req)),
//! )
//! .await
Expand Down
2 changes: 1 addition & 1 deletion src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,6 @@ impl<T> fmt::Debug for State<T> {
.field("limits", &self.limits)
.field("is_readable", &self.is_readable)
.field("boundary", &String::from_utf8_lossy(self.boundary()))
.finish()
.finish_non_exhaustive()
}
}
4 changes: 2 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub(crate) fn parse_content_disposition(hv: &[u8]) -> Result<(String, Option<Str
loop {
if i == hv.len() {
if p == 1 {
if let Some(mut e) = v.last_mut() {
if let Some(e) = v.last_mut() {
e.1 = &hv[if hv[j] == b'"' && hv[i - 1] == b'"' {
j + 1..i - 1
} else {
Expand All @@ -74,7 +74,7 @@ pub(crate) fn parse_content_disposition(hv: &[u8]) -> Result<(String, Option<Str
match b {
b';' => {
if p == 1 {
if let Some(mut e) = v.last_mut() {
if let Some(e) = v.last_mut() {
e.1 = &hv[if hv[j] == b'"' && hv[i - 1] == b'"' {
j + 1..i - 1
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/limited.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl<T> fmt::Debug for Limited<T> {
.field("eof", &self.eof)
.field("limit", &self.limit)
.field("length", &self.length)
.finish()
.finish_non_exhaustive()
}
}

Expand Down

0 comments on commit 38e7edc

Please sign in to comment.