mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-27 00:00:24 +02:00
Use implicit format-args captures where applicable (#1709)
This commit is contained in:
@@ -313,7 +313,7 @@ where
|
||||
if let Some(path_without_trailing_slash) = path.strip_suffix('/') {
|
||||
router.route(path_without_trailing_slash, any(redirect_handler))
|
||||
} else {
|
||||
router.route(&format!("{}/", path), any(redirect_handler))
|
||||
router.route(&format!("{path}/"), any(redirect_handler))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -157,10 +157,10 @@ mod tests {
|
||||
.index(|| async { "users#index" })
|
||||
.create(|| async { "users#create" })
|
||||
.new(|| async { "users#new" })
|
||||
.show(|Path(id): Path<u64>| async move { format!("users#show id={}", id) })
|
||||
.edit(|Path(id): Path<u64>| async move { format!("users#edit id={}", id) })
|
||||
.update(|Path(id): Path<u64>| async move { format!("users#update id={}", id) })
|
||||
.destroy(|Path(id): Path<u64>| async move { format!("users#destroy id={}", id) });
|
||||
.show(|Path(id): Path<u64>| async move { format!("users#show id={id}") })
|
||||
.edit(|Path(id): Path<u64>| async move { format!("users#edit id={id}") })
|
||||
.update(|Path(id): Path<u64>| async move { format!("users#update id={id}") })
|
||||
.destroy(|Path(id): Path<u64>| async move { format!("users#destroy id={id}") });
|
||||
|
||||
let mut app = Router::new().merge(users);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user