diff options
Diffstat (limited to 'openpgp/src/message')
-rw-r--r-- | openpgp/src/message/mod.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/openpgp/src/message/mod.rs b/openpgp/src/message/mod.rs index d36ddb3c..30f8268d 100644 --- a/openpgp/src/message/mod.rs +++ b/openpgp/src/message/mod.rs @@ -338,6 +338,14 @@ impl<'a> Parse<'a, Message> for Message { } } +impl std::str::FromStr for Message { + type Err = failure::Error; + + fn from_str(s: &str) -> std::result::Result<Self, Self::Err> { + Self::from_bytes(s.as_bytes()) + } +} + impl Message { /// Converts the `PacketPile` to a `Message`. /// |