Add feature: String from EmailAddress

Implement the From<EmailAddress> trait for String. This allows moving
the underlying String out of EmailAddress without allocating a new
one.

Closes #3
This commit is contained in:
Christopher Morton
2021-11-30 15:06:06 +00:00
parent ec76aef0e0
commit fb1acd933f
+6
View File
@@ -376,6 +376,12 @@ impl FromStr for EmailAddress {
}
}
impl From<EmailAddress> for String {
fn from(email: EmailAddress) -> Self {
email.0
}
}
impl EmailAddress {
///
/// Determine whether the `address` string is a valid email address. Note this is equivalent to