diff --git a/axum/src/routing/mod.rs b/axum/src/routing/mod.rs index 581e9241..a44bb3d1 100644 --- a/axum/src/routing/mod.rs +++ b/axum/src/routing/mod.rs @@ -505,7 +505,7 @@ where ) } Err(MatchError::ExtraTrailingSlash) => { - let new_uri = replace_trailing_slash(req.uri(), &path.strip_suffix('/').unwrap()); + let new_uri = replace_trailing_slash(req.uri(), path.strip_suffix('/').unwrap()); RouteFuture::from_response( Redirect::permanent(&new_uri.to_string()).into_response(),