Skip to content

Commit a0747e9

Browse files
committed
sitemap: don't use checked_ variant when not necessary
1 parent 3079eb3 commit a0747e9

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

crates/bin/docs_rs_web/src/handlers/sitemap.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ pub(crate) async fn sitemapindex_handler() -> impl IntoResponse {
3838
let sitemaps: Vec<char> = ('a'..='z').collect();
3939
let today = Utc::now().date_naive();
4040
let recent_sitemaps = (0..RECENT_SITEMAP_DAYS)
41-
.map(|days| {
42-
today
43-
.checked_sub_days(Days::new(days))
44-
.expect("underflow when building recent sitemap dates")
45-
.format("%F")
46-
.to_string()
47-
})
41+
.map(|days| (today + Days::new(days)).format("%F").to_string())
4842
.collect();
4943

5044
SitemapIndex {

0 commit comments

Comments
 (0)