diff options
author | Nora Widdecke <nora@sequoia-pgp.org> | 2021-11-22 16:28:06 +0100 |
---|---|---|
committer | Nora Widdecke <nora@sequoia-pgp.org> | 2021-11-29 11:53:55 +0100 |
commit | b2ffb4401fad2f5c51f35d56a4408c23c10a3450 (patch) | |
tree | a5584f9024044a162a3850250d2269062a1c1cdd /openpgp/src/cert | |
parent | 8b272c162ce443e26c89afbda6fe4e06dd366118 (diff) |
openpgp: Use functional update syntax.
- Instead of creating a default struct and immediately afterwards
changing a field, use this type of initialization syntax:
Struct { field: value, ..Default::default() }.
- Suggested by clippy::field_reassign_with_default.
Diffstat (limited to 'openpgp/src/cert')
-rw-r--r-- | openpgp/src/cert/parser/mod.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/openpgp/src/cert/parser/mod.rs b/openpgp/src/cert/parser/mod.rs index c384be1f..53c9bcf9 100644 --- a/openpgp/src/cert/parser/mod.rs +++ b/openpgp/src/cert/parser/mod.rs @@ -662,9 +662,10 @@ impl<'a> CertParser<'a> { J: 'a + Into<Result<Packet>>, <I as IntoIterator>::IntoIter: Send + Sync, { - let mut parser : Self = Default::default(); - parser.source = Some(Box::new(iter.into_iter().map(Into::into))); - parser + Self { + source: Some(Box::new(iter.into_iter().map(Into::into))), + ..Default::default() + } } /// Filters the Certs prior to validation. |