summaryrefslogtreecommitdiffstats
path: root/openpgp/src/types/timestamp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/src/types/timestamp.rs')
-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 78c5180f..fb18f082 100644
--- a/openpgp/src/types/timestamp.rs
+++ b/openpgp/src/types/timestamp.rs
@@ -133,7 +133,7 @@ impl Timestamp {
/// Returns `None` if the resulting timestamp is not
/// representable.
pub fn checked_add(&self, d: Duration) -> Option<Timestamp> {
- self.0.checked_add(d.0).map(|v| Self(v))
+ self.0.checked_add(d.0).map(Self)
}
/// Subtracts a duration from this timestamp.
@@ -141,7 +141,7 @@ impl Timestamp {
/// Returns `None` if the resulting timestamp is not
/// representable.
pub fn checked_sub(&self, d: Duration) -> Option<Timestamp> {
- self.0.checked_sub(d.0).map(|v| Self(v))
+ self.0.checked_sub(d.0).map(Self)
}
/// Rounds down to the given level of precision.