From 86331613f4d4b82448c12fcd8f46ebeea02d8a9b Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Mon, 3 Jan 2022 16:32:35 +0100 Subject: [PATCH] Add some debug assertions (#686) * Add some debug assertions As discussed in Discord its probably worth having debug assertions for these two cases, should we accidentally break them in the future. * remove assertion in `OriginalUri` --- axum/src/routing/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/axum/src/routing/mod.rs b/axum/src/routing/mod.rs index 7eac8c66..788d0c1f 100644 --- a/axum/src/routing/mod.rs +++ b/axum/src/routing/mod.rs @@ -417,6 +417,9 @@ where Arc::clone(matched_path) }; req.extensions_mut().insert(MatchedPath(matched_path)); + } else { + #[cfg(debug_assertions)] + panic!("should always have a matched path for a route id"); } let params = match_