prettier tuple handling

This commit is contained in:
Tomáš Mládek 2021-07-25 16:49:39 +02:00
parent 4eb1ae5402
commit 68279afeeb

View file

@ -228,8 +228,8 @@ async fn render(
.pages
.clone()
.into_iter()
.filter_map(|i| match i.1.timestamp {
Some(ts) => Some((i.0, SystemTime::now().duration_since(ts).unwrap())),
.filter_map(|(path, page)| match page.timestamp {
Some(ts) => Some((path, SystemTime::now().duration_since(ts).unwrap())),
None => None,
})
.collect::<Vec<(String, Duration)>>();
@ -249,7 +249,7 @@ async fn render(
"recently_changed",
&recently_changed
.into_iter()
.map(|i| (i.0, timeago.convert(i.1)))
.map(|(path, duration)| (path, timeago.convert(duration)))
.collect::<Vec<(String, String)>>(),
);
context.insert(