From 51f13083867b1d63097e89f276d6ba59bd35378b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Kochen?= Date: Wed, 15 Nov 2023 19:56:52 +0100 Subject: [PATCH 1/2] Upgrade to hyper 1.0 --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1464dad..922289d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,10 +13,10 @@ edition = "2018" [dependencies] futures-util = "0.3.1" -http = "0.2.0" +http = "1.0.0" httpdate = "1.0.1" http-range = "0.1.4" -hyper = "1.0.0-rc.4" +hyper = "1.0.0" mime_guess = "2.0.1" percent-encoding = "2.1.0" rand = "0.8.4" @@ -24,9 +24,9 @@ tokio = { version = "1.0.0", features = ["fs"] } url = "2.1.0" [dev-dependencies] -hyper = { version = "1.0.0-rc.4", features = ["http1", "server"] } +hyper = { version = "1.0.0", features = ["http1", "server"] } hyper-util = { git = "https://github.com/hyperium/hyper-util.git" } -http-body-util = "0.1.0-rc.3" +http-body-util = "0.1.0" tempfile = "3" tokio = { version = "1.0.0", features = ["macros", "rt-multi-thread", "net", "io-util"] } From 94d39dbc87c109626173f7ce61de2bd46db37a10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Kochen?= Date: Wed, 15 Nov 2023 19:59:03 +0100 Subject: [PATCH 2/2] cargo clippy --fix --- src/vfs.rs | 2 +- tests/static.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vfs.rs b/src/vfs.rs index d0ce8a3..1b56094 100644 --- a/src/vfs.rs +++ b/src/vfs.rs @@ -142,7 +142,7 @@ impl FileAccess for TokioFileAccess { ref mut read_buf, } = *self; - let len = min(len, read_buf.len()) as usize; + let len = min(len, read_buf.len()); let mut read_buf = ReadBuf::uninit(&mut read_buf[..len]); match Pin::new(file).poll_read(cx, &mut read_buf) { Poll::Ready(Ok(())) => { diff --git a/tests/static.rs b/tests/static.rs index ec907d3..785f168 100644 --- a/tests/static.rs +++ b/tests/static.rs @@ -264,7 +264,7 @@ async fn last_modified_is_gmt() { let mut file_path = harness.dir.path().to_path_buf(); file_path.push("file1.html"); let status = Command::new("touch") - .args(&["-t", "198510260122.00"]) + .args(["-t", "198510260122.00"]) .arg(file_path) .env("TZ", "UTC") .status() @@ -288,7 +288,7 @@ async fn no_headers_for_invalid_mtime() { let mut file_path = harness.dir.path().to_path_buf(); file_path.push("file1.html"); let status = Command::new("touch") - .args(&["-t", "197001010000.01"]) + .args(["-t", "197001010000.01"]) .arg(file_path) .env("TZ", "UTC") .status()