From b6ce2d5cf73402ca3ce8f4665201551ae8a59208 Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Fri, 11 Mar 2022 09:16:34 -0800 Subject: [PATCH] util: remove deprecated `ServiceExt::ready_and` These was deprecated in #567. In 0.5, we can just remove them entirely. --- tower/CHANGELOG.md | 4 ++++ tower/src/util/mod.rs | 14 -------------- tower/src/util/ready.rs | 8 -------- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/tower/CHANGELOG.md b/tower/CHANGELOG.md index 4a055ec45..aceb24739 100644 --- a/tower/CHANGELOG.md +++ b/tower/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - None. +### Changed + +- **util**: Removed deprecated `ServiceExt::ready_and` method and future + # 0.4.12 (February 16, 2022) ### Fixed diff --git a/tower/src/util/mod.rs b/tower/src/util/mod.rs index 7e34b65ce..cbcad5050 100644 --- a/tower/src/util/mod.rs +++ b/tower/src/util/mod.rs @@ -19,7 +19,6 @@ mod ready; mod service_fn; mod then; -#[allow(deprecated)] pub use self::{ and_then::{AndThen, AndThenLayer}, boxed::{BoxLayer, BoxService, UnsyncBoxService}, @@ -72,19 +71,6 @@ pub trait ServiceExt: tower_service::Service { Ready::new(self) } - /// Yields a mutable reference to the service when it is ready to accept a request. - #[deprecated( - since = "0.4.6", - note = "please use the `ServiceExt::ready` method instead" - )] - #[allow(deprecated)] - fn ready_and(&mut self) -> ReadyAnd<'_, Self, Request> - where - Self: Sized, - { - ReadyAnd::new(self) - } - /// Yields the service when it is ready to accept a request. fn ready_oneshot(self) -> ReadyOneshot where diff --git a/tower/src/util/ready.rs b/tower/src/util/ready.rs index 8b0fe2c89..668d50143 100644 --- a/tower/src/util/ready.rs +++ b/tower/src/util/ready.rs @@ -69,14 +69,6 @@ where /// [`ServiceExt::ready`]: crate::util::ServiceExt::ready pub struct Ready<'a, T, Request>(ReadyOneshot<&'a mut T, Request>); -/// A future that yields a mutable reference to the service when it is ready to accept a request. -/// -/// [`ReadyAnd`] values are produced by [`ServiceExt::ready_and`]. -/// -/// [`ServiceExt::ready_and`]: crate::util::ServiceExt::ready_and -#[deprecated(since = "0.4.6", note = "Please use the Ready future instead")] -pub type ReadyAnd<'a, T, Request> = Ready<'a, T, Request>; - // Safety: This is safe for the same reason that the impl for ReadyOneshot is safe. impl<'a, T, Request> Unpin for Ready<'a, T, Request> {}