diff options
author | Nora Widdecke <nora@sequoia-pgp.org> | 2021-04-07 16:12:06 +0200 |
---|---|---|
committer | Nora Widdecke <nora@sequoia-pgp.org> | 2021-04-09 13:13:58 +0200 |
commit | a23a14d0471512d360364b69df51161e84c9e0d0 (patch) | |
tree | 96f9c3d1ba810656bc72788bb354d727772b4fb9 /openpgp/src/types | |
parent | 0c538f122d7a498a58f9b380b6be03a40f827c3e (diff) |
Lint: Remove redundant closures.
- https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
Diffstat (limited to 'openpgp/src/types')
-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 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. |