summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKartikaya Gupta <kats@trevize.staktrace.com>2019-11-10 21:26:08 -0500
committerKartikaya Gupta <kats@trevize.staktrace.com>2019-11-10 21:26:08 -0500
commit472758d4ca93b85352c788b68e95b0583be77f0d (patch)
treeedbb32ce36571c1fe37f14f5a0b03df9dcc5db20
parentbae7479ee8ff29309cae0bb21069dde0f2bd7dfb (diff)
downloadmailparse-472758d4ca93b85352c788b68e95b0583be77f0d.tar.gz
mailparse-472758d4ca93b85352c788b68e95b0583be77f0d.tar.xz
Add Clone implementation to addr types
-rw-r--r--Cargo.toml2
-rw-r--r--src/addrparse.rs6
2 files changed, 4 insertions, 4 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 7e1d9cb..07b8510 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "mailparse"
-version = "0.9.1"
+version = "0.9.2"
authors = ["Kartikaya Gupta <kats@seldon.staktrace.com>"]
description = "A simple parser for MIME e-mail messages"
documentation = "https://docs.rs/mailparse/"
diff --git a/src/addrparse.rs b/src/addrparse.rs
index e60c955..3ef4d95 100644
--- a/src/addrparse.rs
+++ b/src/addrparse.rs
@@ -1,6 +1,6 @@
/// A representation of a single mailbox. Each mailbox has
/// a routing address `addr` and an optional display name.
-#[derive(Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq)]
pub struct SingleInfo {
pub display_name: Option<String>,
pub addr: String,
@@ -17,7 +17,7 @@ impl SingleInfo {
/// A representation of a group address. It has a name and
/// a list of mailboxes.
-#[derive(Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq)]
pub struct GroupInfo {
pub group_name: String,
pub addrs: Vec<SingleInfo>,
@@ -38,7 +38,7 @@ impl GroupInfo {
/// an email address (e.g. foo@bar.com) and optionally a display name ("Foo Bar").
/// Groups are represented in email headers with colons and semicolons, e.g.
/// To: my-peeps: foo@peeps.org, bar@peeps.org;
-#[derive(Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq)]
pub enum MailAddr {
Group(GroupInfo),
Single(SingleInfo),