From 123b1b3c5e6e411932799732f782bc77653cc803 Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Sat, 7 Aug 2021 16:22:53 +0200 Subject: [PATCH] Remove future re-exports (#133) These types were moved around in https://github.com/tokio-rs/axum/pull/130 but re-export from their old location for backwards compatibility. This removes the re-exports. --- CHANGELOG.md | 6 ++++++ src/extract/extractor_middleware.rs | 7 ------- src/handler/mod.rs | 2 +- src/routing.rs | 6 +----- src/service/mod.rs | 6 +----- 5 files changed, 9 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbce9eef85..fce9068c5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Breaking changes +- `extract::extractor_middleware::ExtractorMiddlewareResponseFuture` moved + to `extract::extractor_middleware::future::ResponseFuture` ([#133](https://github.com/tokio-rs/axum/pull/133)) +- `routing::BoxRouteFuture` moved to `routing::future::BoxRouteFuture` ([#133](https://github.com/tokio-rs/axum/pull/133)) +- `routing::EmptyRouterFuture` moved to `routing::future::EmptyRouterFuture` ([#133](https://github.com/tokio-rs/axum/pull/133)) +- `routing::RouteFuture` moved to `routing::future::RouteFuture` ([#133](https://github.com/tokio-rs/axum/pull/133)) +- `service::BoxResponseBodyFuture` moved to `service::future::BoxResponseBodyFuture` ([#133](https://github.com/tokio-rs/axum/pull/133)) - The following types no longer implement `Copy` ([#132](https://github.com/tokio-rs/axum/pull/132)): - `EmptyRouter` - `ExtractorMiddleware` diff --git a/src/extract/extractor_middleware.rs b/src/extract/extractor_middleware.rs index f648dd9906..7f28f3cc9a 100644 --- a/src/extract/extractor_middleware.rs +++ b/src/extract/extractor_middleware.rs @@ -182,13 +182,6 @@ where } } -#[doc(hidden)] -#[deprecated( - since = "0.1.3", - note = "Use axum::extract::extractor_middleware::ResponseFuture" -)] -pub type ExtractorMiddlewareResponseFuture = ResponseFuture; - pin_project! { /// Response future for [`ExtractorMiddleware`]. #[allow(missing_debug_implementations)] diff --git a/src/handler/mod.rs b/src/handler/mod.rs index c6b4b4d838..d38edb898b 100644 --- a/src/handler/mod.rs +++ b/src/handler/mod.rs @@ -4,7 +4,7 @@ use crate::{ body::{box_body, BoxBody}, extract::FromRequest, response::IntoResponse, - routing::{EmptyRouter, MethodFilter, RouteFuture}, + routing::{future::RouteFuture, EmptyRouter, MethodFilter}, service::HandleError, }; use async_trait::async_trait; diff --git a/src/routing.rs b/src/routing.rs index fd54c0f41d..30f9ccf739 100644 --- a/src/routing.rs +++ b/src/routing.rs @@ -1,5 +1,6 @@ //! Routing between [`Service`]s. +use self::future::{BoxRouteFuture, EmptyRouterFuture, RouteFuture}; use crate::{ body::{box_body, BoxBody}, buffer::MpscBuffer, @@ -27,11 +28,6 @@ use tower_http::map_response_body::MapResponseBodyLayer; pub mod future; -// for backwards compatibility -// TODO: remove these in 0.2 -#[doc(hidden)] -pub use self::future::{BoxRouteFuture, EmptyRouterFuture, RouteFuture}; - /// A filter that matches one or more HTTP methods. #[derive(Debug, Copy, Clone)] pub enum MethodFilter { diff --git a/src/service/mod.rs b/src/service/mod.rs index 401c3a840a..3d6508b6cb 100644 --- a/src/service/mod.rs +++ b/src/service/mod.rs @@ -89,7 +89,7 @@ use crate::{ body::BoxBody, response::IntoResponse, - routing::{EmptyRouter, MethodFilter, RouteFuture}, + routing::{future::RouteFuture, EmptyRouter, MethodFilter}, }; use bytes::Bytes; use http::{Request, Response}; @@ -103,10 +103,6 @@ use tower::{util::Oneshot, BoxError, Service, ServiceExt as _}; pub mod future; -// for backwards compatibility -#[doc(hidden)] -pub use future::BoxResponseBodyFuture; - /// Route requests to the given service regardless of the HTTP method. /// /// See [`get`] for an example.