Skip to content

Commit 3d5042f

Browse files
Bump tower-http to v0.5
1 parent 5a6a4a8 commit 3d5042f

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

examples/axum-key-value-store/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = "MIT"
88

99
[dependencies]
1010
tokio = { version = "1.32.0", features = ["full"] }
11-
tower = { version = "0.4.13", features = ["full"] }
11+
tower = { version = "0.5", features = ["full"] }
1212
tower-http = { path = "../../tower-http", features = ["full"] }
1313
tracing = "0.1"
1414
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }

examples/tonic-key-value-store/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ tokio = { version = "1.2.0", features = ["full"] }
1414
futures = "0.3"
1515
tokio-stream = { version = "0.1", features = ["sync", "net"] }
1616
tonic = "0.9"
17-
tower = { version = "0.4.5", features = ["full"] }
17+
tower = { version = "0.5", features = ["full"] }
1818
tower-http = { path = "../../tower-http", features = ["full"] }
1919
tracing = "0.1"
2020
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

examples/warp-key-value-store/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ bytes = "1"
1111
clap = { version = "4.3.16", features = ["derive"] }
1212
hyper = { version = "0.14.4", features = ["full"] }
1313
tokio = { version = "1.2.0", features = ["full"] }
14-
tower = { version = "0.4.5", features = ["full"] }
14+
tower = { version = "0.5", features = ["full"] }
1515
tower-http = { path = "../../tower-http", features = ["full"] }
1616
tracing = "0.1"
1717
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

tower-http/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ mime_guess = { version = "2", optional = true, default_features = false }
3434
percent-encoding = { version = "2.1.0", optional = true }
3535
tokio = { version = "1.6", optional = true, default_features = false }
3636
tokio-util = { version = "0.7", optional = true, default_features = false, features = ["io"] }
37-
tower = { version = "0.4.1", optional = true }
37+
tower = { version = "0.5", optional = true }
3838
tracing = { version = "0.1", default_features = false, optional = true }
3939
httpdate = { version = "1.0", optional = true }
4040
uuid = { version = "1.0", features = ["v4"], optional = true }
@@ -52,7 +52,7 @@ once_cell = "1"
5252
serde_json = "1.0"
5353
sync_wrapper = "1"
5454
tokio = { version = "1", features = ["full"] }
55-
tower = { version = "0.4.10", features = ["buffer", "util", "retry", "make", "timeout"] }
55+
tower = { version = "0.5", features = ["buffer", "util", "retry", "make", "timeout"] }
5656
tracing-subscriber = "0.3"
5757
uuid = { version = "1.0", features = ["v4"] }
5858
zstd = "0.13"

tower-http/src/classify/mod.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -397,20 +397,20 @@ mod usable_for_retries {
397397
Request<ReqB>: Clone,
398398
E: std::error::Error + 'static,
399399
{
400-
type Future = std::future::Ready<RetryBasedOnClassification<C>>;
400+
type Future = std::future::Ready<()>;
401401

402402
fn retry(
403-
&self,
404-
_req: &Request<ReqB>,
405-
res: Result<&Response<ResB>, &E>,
403+
&mut self,
404+
_req: &mut Request<ReqB>,
405+
res: &mut Result<Response<ResB>, E>,
406406
) -> Option<Self::Future> {
407407
match res {
408408
Ok(res) => {
409409
if let ClassifiedResponse::Ready(class) =
410410
self.classifier.clone().classify_response(res)
411411
{
412412
if class.err()?.is_retryable() {
413-
return Some(std::future::ready(self.clone()));
413+
return Some(std::future::ready(()));
414414
}
415415
}
416416

@@ -421,11 +421,11 @@ mod usable_for_retries {
421421
.clone()
422422
.classify_error(err)
423423
.is_retryable()
424-
.then(|| std::future::ready(self.clone())),
424+
.then(|| std::future::ready(())),
425425
}
426426
}
427427

428-
fn clone_request(&self, req: &Request<ReqB>) -> Option<Request<ReqB>> {
428+
fn clone_request(&mut self, req: &Request<ReqB>) -> Option<Request<ReqB>> {
429429
Some(req.clone())
430430
}
431431
}

0 commit comments

Comments
 (0)