summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2020-12-14 22:28:40 +0100
committerNeal H. Walfield <neal@pep.foundation>2020-12-14 22:52:43 +0100
commit02a3a4851ab7daf3cab1271f962972425a45c441 (patch)
tree5f8aa7e5d2ecd4ffd162ff67602571f95caa8165
parent8c50ba96a5434aeefbf44e0d034072dfc6669521 (diff)
openpgp: Make Duration::seconds a const fn.
- Make `Duration::seconds` a const fn.
-rw-r--r--openpgp/src/types/timestamp.rs4
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