Skip to content

Commit 5e740a4

Browse files
committed
rename route parameter name
1 parent 5ca1db9 commit 5e740a4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/web/routes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub(super) fn build_routes() -> Routes {
1818
routes.static_resource("/favicon.ico", PermanentRedirect("/-/static/favicon.ico"));
1919
routes.static_resource("/sitemap.xml", super::sitemap::sitemapindex_handler);
2020
routes.static_resource(
21-
"/-/sitemap/:which/sitemap.xml",
21+
"/-/sitemap/:letter/sitemap.xml",
2222
super::sitemap::sitemap_handler,
2323
);
2424

src/web/sitemap.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl_webpage! {
4040

4141
pub fn sitemap_handler(req: &mut Request) -> IronResult<Response> {
4242
let router = extension!(req, Router);
43-
let which = cexpect!(req, router.find("which")).to_lowercase();
43+
let letter = cexpect!(req, router.find("letter")).to_lowercase();
4444

4545
let mut conn = extension!(req, Pool).get()?;
4646
let query = conn
@@ -60,8 +60,8 @@ pub fn sitemap_handler(req: &mut Request) -> IronResult<Response> {
6060
&[
6161
// this LIKE pattern has the '%' only at the end,
6262
// so postgres can use the index on `name`
63-
&format!("{}%", which),
64-
&format!("{}%", which.to_uppercase()),
63+
&format!("{}%", letter),
64+
&format!("{}%", letter.to_uppercase()),
6565
],
6666
)
6767
.unwrap();

0 commit comments

Comments
 (0)