diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-09-03 12:07:07 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-09-03 12:36:04 +0200 |
commit | 7dac87c8d4d9a6ef7fe069cf78a640b4d57f6a28 (patch) | |
tree | 11d85b5796ecfd5afc17e3b16b557bc0a98623f2 /openpgp | |
parent | e707009b23f275060ed1db98d782f2a7600d2d94 (diff) |
openpgp: Simplify constructors.
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/src/packet/userid.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/openpgp/src/packet/userid.rs b/openpgp/src/packet/userid.rs index ca47f620..1a3a05ce 100644 --- a/openpgp/src/packet/userid.rs +++ b/openpgp/src/packet/userid.rs @@ -65,11 +65,7 @@ impl From<Vec<u8>> for UserID { impl From<&[u8]> for UserID { fn from(u: &[u8]) -> Self { - UserID { - common: Default::default(), - value: u.to_vec(), - parsed: RefCell::new(None), - } + u.to_vec().into() } } @@ -146,11 +142,7 @@ impl Hash for UserID { impl Clone for UserID { fn clone(&self) -> Self { - UserID { - common: self.common.clone(), - value: self.value.clone(), - parsed: RefCell::new(None), - } + self.value.clone().into() } } |