From 6aee8f4936351fdd19afa4d7f9cd126ab0da4a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Wed, 27 Dec 2023 02:17:05 +0000 Subject: [PATCH 1/4] Update indexmap dependency & fix compiler warnings --- tower/Cargo.toml | 5 ++--- tower/src/ready_cache/cache.rs | 4 ++-- tower/src/util/call_all/ordered.rs | 2 +- tower/src/util/rng.rs | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tower/Cargo.toml b/tower/Cargo.toml index 96269dc80..351f220a1 100644 --- a/tower/Cargo.toml +++ b/tower/Cargo.toml @@ -20,7 +20,7 @@ clients and servers. categories = ["asynchronous", "network-programming"] keywords = ["io", "async", "non-blocking", "futures", "service"] edition = "2018" -rust-version = "1.49.0" +rust-version = "1.63.0" [features] @@ -71,7 +71,7 @@ tower-service = { version = "0.3.1", path = "../tower-service" } futures-core = { version = "0.3", optional = true } futures-util = { version = "0.3", default-features = false, features = ["alloc"], optional = true } hdrhistogram = { version = "7.0", optional = true, default-features = false } -indexmap = { version = "1.0.2", optional = true } +indexmap = { version = "2.0", optional = true } slab = { version = "0.4", optional = true } tokio = { version = "1.6", optional = true, features = ["sync"] } tokio-stream = { version = "0.1.0", optional = true } @@ -91,7 +91,6 @@ tower-test = { version = "0.4", path = "../tower-test" } tracing = { version = "0.1.2", default-features = false, features = ["std"] } tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "ansi"] } http = "0.2" -lazy_static = "1.4.0" rand = { version = "0.8", features = ["small_rng"] } quickcheck = "1" diff --git a/tower/src/ready_cache/cache.rs b/tower/src/ready_cache/cache.rs index 282f2bb83..f44bcda24 100644 --- a/tower/src/ready_cache/cache.rs +++ b/tower/src/ready_cache/cache.rs @@ -4,7 +4,7 @@ use super::error; use futures_core::Stream; use futures_util::{stream::FuturesUnordered, task::AtomicWaker}; pub use indexmap::Equivalent; -use indexmap::IndexMap; +use indexmap::{IndexMap, map::MutableKeys as _}; use std::fmt; use std::future::Future; use std::hash::Hash; @@ -194,7 +194,7 @@ where /// Obtains a mutable reference to a service in the ready set by index. pub fn get_ready_index_mut(&mut self, idx: usize) -> Option<(&mut K, &mut S)> { - self.ready.get_index_mut(idx).map(|(k, v)| (k, &mut v.0)) + self.ready.get_index_mut2(idx).map(|(k, v)| (k, &mut v.0)) } /// Returns an iterator over the ready keys and services. diff --git a/tower/src/util/call_all/ordered.rs b/tower/src/util/call_all/ordered.rs index cf55c2214..b89cef095 100644 --- a/tower/src/util/call_all/ordered.rs +++ b/tower/src/util/call_all/ordered.rs @@ -168,7 +168,7 @@ impl common::Drive for FuturesOrdered { } fn push(&mut self, future: F) { - FuturesOrdered::push(self, future) + FuturesOrdered::push_back(self, future) } fn poll(&mut self, cx: &mut Context<'_>) -> Poll> { diff --git a/tower/src/util/rng.rs b/tower/src/util/rng.rs index d520ffce6..e1e8375e6 100644 --- a/tower/src/util/rng.rs +++ b/tower/src/util/rng.rs @@ -174,7 +174,7 @@ mod tests { let mut r = HasherRng::default(); match super::sample_floyd2(&mut r, 2) { [0, 1] | [1, 0] => (), - err => panic!("{err:?}"), + err => panic!("{:?}", err), } } } From 48d7d3e2cb87d22adb823ffc48bb715ce542daad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Fri, 12 Jan 2024 19:53:46 +0000 Subject: [PATCH 2/4] Update tower/src/ready_cache/cache.rs Co-authored-by: Josh Stone --- tower/src/ready_cache/cache.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tower/src/ready_cache/cache.rs b/tower/src/ready_cache/cache.rs index f44bcda24..93911f182 100644 --- a/tower/src/ready_cache/cache.rs +++ b/tower/src/ready_cache/cache.rs @@ -4,7 +4,7 @@ use super::error; use futures_core::Stream; use futures_util::{stream::FuturesUnordered, task::AtomicWaker}; pub use indexmap::Equivalent; -use indexmap::{IndexMap, map::MutableKeys as _}; +use indexmap::{map::MutableKeys as _, IndexMap}; use std::fmt; use std::future::Future; use std::hash::Hash; From bdee7c412e7f4c419a1cd28729e0859e42ae2376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Fri, 12 Jan 2024 19:53:56 +0000 Subject: [PATCH 3/4] Update tower/Cargo.toml Co-authored-by: Josh Stone --- tower/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tower/Cargo.toml b/tower/Cargo.toml index 351f220a1..269dbcd11 100644 --- a/tower/Cargo.toml +++ b/tower/Cargo.toml @@ -71,7 +71,7 @@ tower-service = { version = "0.3.1", path = "../tower-service" } futures-core = { version = "0.3", optional = true } futures-util = { version = "0.3", default-features = false, features = ["alloc"], optional = true } hdrhistogram = { version = "7.0", optional = true, default-features = false } -indexmap = { version = "2.0", optional = true } +indexmap = { version = "2.0.2", optional = true } slab = { version = "0.4", optional = true } tokio = { version = "1.6", optional = true, features = ["sync"] } tokio-stream = { version = "0.1.0", optional = true } From 56183deaa327036d6811004c324fbad5e97cc5fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Wed, 27 Dec 2023 02:17:05 +0000 Subject: [PATCH 4/4] Update indexmap dependency & fix compiler warnings --- .github/workflows/CI.yml | 2 +- tower/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c60296707..9d1679d50 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -7,7 +7,7 @@ on: pull_request: {} env: - MSRV: 1.49.0 + MSRV: 1.63.0 jobs: check-stable: diff --git a/tower/Cargo.toml b/tower/Cargo.toml index 269dbcd11..f98d148aa 100644 --- a/tower/Cargo.toml +++ b/tower/Cargo.toml @@ -69,7 +69,7 @@ tower-layer = { version = "0.3.1", path = "../tower-layer" } tower-service = { version = "0.3.1", path = "../tower-service" } futures-core = { version = "0.3", optional = true } -futures-util = { version = "0.3", default-features = false, features = ["alloc"], optional = true } +futures-util = { version = "0.3.22", default-features = false, features = ["alloc"], optional = true } hdrhistogram = { version = "7.0", optional = true, default-features = false } indexmap = { version = "2.0.2", optional = true } slab = { version = "0.4", optional = true }