Use implicit format-args captures where applicable (#1709)

This commit is contained in:
Jonas Platte
2023-01-20 12:04:49 +01:00
committed by GitHub
parent b07918b213
commit 7ecf8bd6cf
16 changed files with 42 additions and 46 deletions
+1 -1
View File
@@ -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))
}
}
+4 -4
View File
@@ -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);