From 70e3024068b1eb60c48d9f7176d6005bb4690678 Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Wed, 9 Mar 2022 11:05:24 +0100 Subject: [PATCH] Don't set extension we never use (#844) * Remove unused internal helper * Don't set extension we never use --- axum/src/body/mod.rs | 4 ---- axum/src/routing/mod.rs | 1 - 2 files changed, 5 deletions(-) diff --git a/axum/src/body/mod.rs b/axum/src/body/mod.rs index c788207c..4eceec0c 100644 --- a/axum/src/body/mod.rs +++ b/axum/src/body/mod.rs @@ -15,7 +15,3 @@ pub use bytes::Bytes; #[doc(inline)] pub use axum_core::body::{boxed, BoxBody}; - -pub(crate) fn empty() -> BoxBody { - boxed(Empty::new()) -} diff --git a/axum/src/routing/mod.rs b/axum/src/routing/mod.rs index 7e957228..de24fc8b 100644 --- a/axum/src/routing/mod.rs +++ b/axum/src/routing/mod.rs @@ -421,7 +421,6 @@ where mut req: Request, ) -> RouteFuture { let id = *match_.value; - req.extensions_mut().insert(id); #[cfg(feature = "matched-path")] if let Some(matched_path) = self.node.route_id_to_path.get(&id) {