Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to indexmap v2 (MSRV 1.63) #741

Merged
merged 2 commits into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request: {}

env:
MSRV: 1.49.0
MSRV: 1.63.0

jobs:
check-stable:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pattern. If your protocol is entirely stream based, Tower may not be a good fit.

Tower will keep a rolling MSRV (minimum supported Rust version) policy of **at
least** 6 months. When increasing the MSRV, the new Rust version must have been
released at least six months ago. The current MSRV is 1.49.0.
released at least six months ago. The current MSRV is 1.63.0.

## Getting Started

Expand Down
4 changes: 2 additions & 2 deletions tower/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -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.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 }
Expand Down
2 changes: 1 addition & 1 deletion tower/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Tower.

Tower will keep a rolling MSRV (minimum supported Rust version) policy of **at
least** 6 months. When increasing the MSRV, the new Rust version must have been
released at least six months ago. The current MSRV is 1.49.0.
released at least six months ago. The current MSRV is 1.63.0.

## License

Expand Down
2 changes: 1 addition & 1 deletion tower/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
//!
//! Tower will keep a rolling MSRV (minimum supported Rust version) policy of **at
//! least** 6 months. When increasing the MSRV, the new Rust version must have been
//! released at least six months ago. The current MSRV is 1.49.0.
//! released at least six months ago. The current MSRV is 1.63.0.
//!
//! [`Service`]: crate::Service
//! [`Layer`]: crate::Layer
Expand Down
2 changes: 1 addition & 1 deletion tower/src/ready_cache/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,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)> {
pub fn get_ready_index_mut(&mut self, idx: usize) -> Option<(&K, &mut S)> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change, so I suppose it should go on your 0.5 milestone. But if you really want the mutable key, there's an opt-in by using the MutableKeys trait and its get_index_mut2 method.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's feels like more of a footgun to have the key be mutable, given the warnings mentioned in MutableKeys::get_index_mut2... and there's really nothing in the original PR or docs that speaks specifically to the key needing to be mutable... so I think this is a worthwhile change to make given that changing the MSRV is breaking anyways.

self.ready.get_index_mut(idx).map(|(k, v)| (k, &mut v.0))
}

Expand Down
Loading