diff options
author | Neal H. Walfield <neal@pep.foundation> | 2020-12-14 22:28:40 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2020-12-14 22:52:43 +0100 |
commit | 02a3a4851ab7daf3cab1271f962972425a45c441 (patch) | |
tree | 5f8aa7e5d2ecd4ffd162ff67602571f95caa8165 /openpgp/src/types/timestamp.rs | |
parent | 8c50ba96a5434aeefbf44e0d034072dfc6669521 (diff) |
openpgp: Make Duration::seconds a const fn.
- Make `Duration::seconds` a const fn.
Diffstat (limited to 'openpgp/src/types/timestamp.rs')
-rw-r--r-- | openpgp/src/types/timestamp.rs | 4 |
1 files 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 |