summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKartikaya Gupta <kats@trevize.staktrace.com>2019-11-28 07:25:01 -0500
committerKartikaya Gupta <kats@trevize.staktrace.com>2019-11-28 07:25:01 -0500
commit8aa516e5f8aeb1dd15a45edf04df825c95f17d6d (patch)
treeb2e579ff1d41e1535b2edb9b4baeb77f4bad47e7
parentb6cb270453cd27cdcd7ba6d1874df2f7d215f45c (diff)
downloadmailparse-8aa516e5f8aeb1dd15a45edf04df825c95f17d6d.tar.gz
mailparse-8aa516e5f8aeb1dd15a45edf04df825c95f17d6d.tar.xz
Add From impl for convenience
-rw-r--r--src/addrparse.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/addrparse.rs b/src/addrparse.rs
index 8995c93..99fb1a9 100644
--- a/src/addrparse.rs
+++ b/src/addrparse.rs
@@ -130,6 +130,12 @@ impl fmt::Display for MailAddrList {
}
}
+impl From<Vec<MailAddr>> for MailAddrList {
+ fn from(addrs: Vec<MailAddr>) -> Self {
+ MailAddrList(addrs)
+ }
+}
+
impl MailAddrList {
/// Count the number of `SingleInfo` instances in this list of addresses.
pub fn count_addrs(&self) -> usize {