diff options
author | Neal H. Walfield <neal@pep.foundation> | 2019-05-31 17:50:04 +0200 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2019-05-31 17:50:04 +0200 |
commit | ce68ba8413c177195e37c7ea044b284bc988c185 (patch) | |
tree | 8f3f0365c9bf2de56f6e82af5a17f96f7ce94a28 /openpgp | |
parent | 462dfe832f54da751dd521da185b0a468d3c4a28 (diff) |
openpgp: Implement From<String> for UserID
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/src/packet/userid.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/openpgp/src/packet/userid.rs b/openpgp/src/packet/userid.rs index e9721d39..f4b8ae5f 100644 --- a/openpgp/src/packet/userid.rs +++ b/openpgp/src/packet/userid.rs @@ -74,6 +74,13 @@ impl<'a> From<&'a str> for UserID { } } +impl From<String> for UserID { + fn from(u: String) -> Self { + let u = &u[..]; + u.into() + } +} + impl<'a> From<::std::borrow::Cow<'a, str>> for UserID { fn from(u: ::std::borrow::Cow<'a, str>) -> Self { let b = u.as_bytes(); |