aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/src/atuin_server/metrics.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-13 01:36:41 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-13 01:36:41 +0200
commit47b76481e51451827530714512b30882d85e3a9a (patch)
tree3e64edfa304e11e4dff506683dd0a7ea7929123e /crates/turtle/src/atuin_server/metrics.rs
parentchore(treewide): Fix some of `clippy`'s error (diff)
downloadatuin-47b76481e51451827530714512b30882d85e3a9a.zip
chore(treewide): Also fix all `clippy` warnings
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();