From 68279afeeb52a1315bf7d4ba07fb189a6508c553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Sun, 25 Jul 2021 16:49:39 +0200 Subject: [PATCH] prettier tuple handling --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index e3cd885..2210e51 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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::>(); @@ -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::>(), ); context.insert(