From 02a3a4851ab7daf3cab1271f962972425a45c441 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Mon, 14 Dec 2020 22:28:40 +0100 Subject: openpgp: Make Duration::seconds a const fn. - Make `Duration::seconds` a const fn. --- openpgp/src/types/timestamp.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpgp/src/types/timestamp.rs b/openpgp/src/types/timestamp.rs index ceb31ad7..0852184b 100644 --- a/openpgp/src/types/timestamp.rs +++ b/openpgp/src/types/timestamp.rs @@ -328,8 +328,8 @@ impl fmt::Debug for Duration { impl Duration { /// Returns a `Duration` with the given number of seconds. - pub fn seconds(n: u32) -> Duration { - n.into() + pub const fn seconds(n: u32) -> Duration { + Self(n) } /// Returns a `Duration` with the given number of minutes, if -- cgit v1.2.3