From 028cac4a7266b87e078fff7f5825b79cab250cff Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Wed, 9 Nov 2022 13:36:10 +0100 Subject: [PATCH] Fix compile error in release mode (#1517) --- axum/CHANGELOG.md | 4 +++- axum/src/extract/matched_path.rs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md index 6db978fe..9a3eca14 100644 --- a/axum/CHANGELOG.md +++ b/axum/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # Unreleased -- None. +- **fixed:** Fix compile error in release mode ([#1517]) + +[#1517]: https://github.com/tokio-rs/axum/pull/1517 # 0.6.0-rc.3 (8. November, 2022) diff --git a/axum/src/extract/matched_path.rs b/axum/src/extract/matched_path.rs index ef20cdb9..9ad5457b 100644 --- a/axum/src/extract/matched_path.rs +++ b/axum/src/extract/matched_path.rs @@ -135,6 +135,8 @@ pub(crate) fn set_matched_path_for_request( } else { #[cfg(debug_assertions)] panic!("should always have a matched path for a route id"); + #[cfg(not(debug_assertions))] + return; }; let matched_path = append_nested_matched_path(matched_path, extensions);