diff --git a/examples/axum-key-value-store/Cargo.toml b/examples/axum-key-value-store/Cargo.toml index c8775c9b..8f4566e5 100644 --- a/examples/axum-key-value-store/Cargo.toml +++ b/examples/axum-key-value-store/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT" [dependencies] tokio = { version = "1.32.0", features = ["full"] } -tower = { version = "0.4.13", features = ["full"] } +tower = { version = "0.5", features = ["full"] } tower-http = { path = "../../tower-http", features = ["full"] } tracing = "0.1" tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } diff --git a/examples/tonic-key-value-store/Cargo.toml b/examples/tonic-key-value-store/Cargo.toml index 530c73cf..4e7897a4 100644 --- a/examples/tonic-key-value-store/Cargo.toml +++ b/examples/tonic-key-value-store/Cargo.toml @@ -14,7 +14,7 @@ tokio = { version = "1.2.0", features = ["full"] } futures = "0.3" tokio-stream = { version = "0.1", features = ["sync", "net"] } tonic = "0.9" -tower = { version = "0.4.5", features = ["full"] } +tower = { version = "0.5", features = ["full"] } tower-http = { path = "../../tower-http", features = ["full"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/examples/warp-key-value-store/Cargo.toml b/examples/warp-key-value-store/Cargo.toml index bc7deef3..afe8666f 100644 --- a/examples/warp-key-value-store/Cargo.toml +++ b/examples/warp-key-value-store/Cargo.toml @@ -11,7 +11,7 @@ bytes = "1" clap = { version = "4.3.16", features = ["derive"] } hyper = { version = "0.14.4", features = ["full"] } tokio = { version = "1.2.0", features = ["full"] } -tower = { version = "0.4.5", features = ["full"] } +tower = { version = "0.5", features = ["full"] } tower-http = { path = "../../tower-http", features = ["full"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/tower-http/CHANGELOG.md b/tower-http/CHANGELOG.md index f1b3fb4e..d62b5795 100644 --- a/tower-http/CHANGELOG.md +++ b/tower-http/CHANGELOG.md @@ -5,13 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -# Unreleased +# 0.6.0 ## Changed: - `body` module is disabled except for `catch-panic`, `decompression-*`, `fs`, or `limit` features (BREAKING) ([#477]) +- Update to `tower` 0.5 ([#503]) [#477]: https://github.com/tower-rs/tower-http/pull/477 +[#503]: https://github.com/tower-rs/tower-http/pull/503 # 0.5.2 diff --git a/tower-http/Cargo.toml b/tower-http/Cargo.toml index 489b585d..1e4b6cc6 100644 --- a/tower-http/Cargo.toml +++ b/tower-http/Cargo.toml @@ -34,7 +34,7 @@ mime_guess = { version = "2", optional = true, default_features = false } percent-encoding = { version = "2.1.0", optional = true } tokio = { version = "1.6", optional = true, default_features = false } tokio-util = { version = "0.7", optional = true, default_features = false, features = ["io"] } -tower = { version = "0.4.1", optional = true } +tower = { version = "0.5", optional = true } tracing = { version = "0.1", default_features = false, optional = true } httpdate = { version = "1.0", optional = true } uuid = { version = "1.0", features = ["v4"], optional = true } @@ -52,7 +52,7 @@ once_cell = "1" serde_json = "1.0" sync_wrapper = "1" tokio = { version = "1", features = ["full"] } -tower = { version = "0.4.10", features = ["buffer", "util", "retry", "make", "timeout"] } +tower = { version = "0.5", features = ["buffer", "util", "retry", "make", "timeout"] } tracing-subscriber = "0.3" uuid = { version = "1.0", features = ["v4"] } zstd = "0.13" diff --git a/tower-http/src/classify/mod.rs b/tower-http/src/classify/mod.rs index 6ea32559..72c4db92 100644 --- a/tower-http/src/classify/mod.rs +++ b/tower-http/src/classify/mod.rs @@ -397,12 +397,12 @@ mod usable_for_retries { Request: Clone, E: std::error::Error + 'static, { - type Future = std::future::Ready>; + type Future = std::future::Ready<()>; fn retry( - &self, - _req: &Request, - res: Result<&Response, &E>, + &mut self, + _req: &mut Request, + res: &mut Result, E>, ) -> Option { match res { Ok(res) => { @@ -410,7 +410,7 @@ mod usable_for_retries { self.classifier.clone().classify_response(res) { if class.err()?.is_retryable() { - return Some(std::future::ready(self.clone())); + return Some(std::future::ready(())); } } @@ -421,11 +421,11 @@ mod usable_for_retries { .clone() .classify_error(err) .is_retryable() - .then(|| std::future::ready(self.clone())), + .then(|| std::future::ready(())), } } - fn clone_request(&self, req: &Request) -> Option> { + fn clone_request(&mut self, req: &Request) -> Option> { Some(req.clone()) } }