diff options
-rw-r--r-- | openpgp/src/packet/userid.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/openpgp/src/packet/userid.rs b/openpgp/src/packet/userid.rs index 1c8b3f84..3f0d88f0 100644 --- a/openpgp/src/packet/userid.rs +++ b/openpgp/src/packet/userid.rs @@ -41,6 +41,16 @@ 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), + } + } +} + impl<'a> From<&'a str> for UserID { fn from(u: &'a str) -> Self { let b = u.as_bytes(); |