change: Add From<Address> implementation for Mailbox (#879)

from-address: It's a simple implementation - it uses the address as the address and uses `None` for the name parameter.
This commit is contained in:
tecc
2023-06-22 10:22:41 +02:00
committed by GitHub
parent f41c9c19ab
commit cd0c032f71

View File

@@ -125,6 +125,12 @@ impl FromStr for Mailbox {
}
}
impl From<Address> for Mailbox {
fn from(value: Address) -> Self {
Self::new(None, value)
}
}
/// Represents a sequence of [`Mailbox`] instances.
///
/// This type contains a sequence of mailboxes (_Some Name \<user@domain.tld\>, Another Name \<other@domain.tld\>, withoutname@domain.tld, ..._).