summaryrefslogtreecommitdiffstats
path: root/openpgp/src/policy.rs
diff options
context:
space:
mode:
authorNora Widdecke <nora@sequoia-pgp.org>2021-04-06 19:58:21 +0200
committerNora Widdecke <nora@sequoia-pgp.org>2021-04-09 13:13:58 +0200
commit9424cd350f32a97479a74d919c646f9e26c2ebce (patch)
treee7b62ae2693ccbcb73d74cacabbf6c9a31a4552e /openpgp/src/policy.rs
parentec5129c0863962dd3ee32b6af29be45d4d979193 (diff)
Lint: Use lazy evaluation.
- https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call
Diffstat (limited to 'openpgp/src/policy.rs')
-rw-r--r--openpgp/src/policy.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/openpgp/src/policy.rs b/openpgp/src/policy.rs
index bb86c631..c915d06d 100644
--- a/openpgp/src/policy.rs
+++ b/openpgp/src/policy.rs
@@ -765,7 +765,7 @@ fn system_time_cutoff_to_timestamp(t: SystemTime) -> Option<Timestamp> {
// An error can only occur if the SystemTime is less than the
// reference time (SystemTime::UNIX_EPOCH). Map that to
// SystemTime::UNIX_EPOCH, as above.
- .unwrap_or(Duration::new(0, 0));
+ .unwrap_or_else(|_| Duration::new(0, 0));
let t = t.as_secs();
if t > u32::MAX as u64 {
// Map to None, as above.