diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-10-19 12:51:15 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-10-19 12:51:35 +0200 |
commit | 7f7c192de8a94064bfab07a41f50b1588fbcee54 (patch) | |
tree | c637ddc730aa72b3d7fc234557e89eb9c7388a47 /openpgp/src/policy.rs | |
parent | 8a3d5750256a8cbc1e56b8281efe658cf4b951de (diff) |
openpgp: Make StandardPolicy::at polymorphic over time.
Diffstat (limited to 'openpgp/src/policy.rs')
-rw-r--r-- | openpgp/src/policy.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/openpgp/src/policy.rs b/openpgp/src/policy.rs index 33d5487f..fba139da 100644 --- a/openpgp/src/policy.rs +++ b/openpgp/src/policy.rs @@ -410,7 +410,10 @@ impl<'a> StandardPolicy<'a> { /// reference time must be set---at the earliest---to the time /// that the message was stored to non-tamperable storage. When /// that is not available, the current time should be used. - pub fn at(time: SystemTime) -> Self { + pub fn at<T>(time: T) -> Self + where T: Into<SystemTime>, + { + let time = time.into(); let mut p = Self::new(); p.time = Some(system_time_cutoff_to_timestamp(time) // Map "ACCEPT" to the end of time (None |