tokio: simplify Option handling with idiomatic combinators (#8336)

This commit is contained in:
Tim Vilgot Mikael Fredenberg
2026-08-07 21:18:39 +08:00
committed by GitHub
parent dd344a550c
commit cc8c053421
17 changed files with 30 additions and 51 deletions
+1 -2
View File
@@ -264,8 +264,7 @@ mod date {
let now = SystemTime::now();
let now_unix = now
.duration_since(SystemTime::UNIX_EPOCH)
.map(|since_epoch| since_epoch.as_secs())
.unwrap_or(0);
.map_or(0, |since_epoch| since_epoch.as_secs());
if cache.unix_date != now_unix {
cache.update(now, now_unix);
}