aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/src/atuin_server/metrics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/turtle/src/atuin_server/metrics.rs')
-rw-r--r--crates/turtle/src/atuin_server/metrics.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/turtle/src/atuin_server/metrics.rs b/crates/turtle/src/atuin_server/metrics.rs
index 556de6fb..6380bef1 100644
--- a/crates/turtle/src/atuin_server/metrics.rs
+++ b/crates/turtle/src/atuin_server/metrics.rs
@@ -28,10 +28,10 @@ pub(crate) fn setup_metrics_recorder() -> PrometheusHandle {
pub(crate) async fn track_metrics(req: Request, next: Next) -> impl IntoResponse {
let start = Instant::now();
- let path = match req.extensions().get::<MatchedPath>() {
- Some(matched_path) => matched_path.as_str().to_owned(),
- _ => req.uri().path().to_owned(),
- };
+ let path = req.extensions().get::<MatchedPath>().map_or_else(
+ || req.uri().path().to_owned(),
+ |matched_path| matched_path.as_str().to_owned(),
+ );
let method = req.method().clone();