Skip to content

Commit

Permalink
util: remove deprecated ServiceExt::ready_and
Browse files Browse the repository at this point in the history
These was deprecated in #567. In 0.5, we can just remove them entirely.
  • Loading branch information
hawkw committed Mar 11, 2022
1 parent d8c73fc commit b6ce2d5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
4 changes: 4 additions & 0 deletions tower/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 0 additions & 14 deletions tower/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ mod ready;
mod service_fn;
mod then;

#[allow(deprecated)]
pub use self::{
and_then::{AndThen, AndThenLayer},
boxed::{BoxLayer, BoxService, UnsyncBoxService},
Expand Down Expand Up @@ -72,19 +71,6 @@ pub trait ServiceExt<Request>: tower_service::Service<Request> {
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<Self, Request>
where
Expand Down
8 changes: 0 additions & 8 deletions tower/src/util/ready.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {}

Expand Down

0 comments on commit b6ce2d5

Please sign in to comment.