use alloc::string::String;
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))]
pub struct Address {
pub name: Option<String>,
pub email: String,
}
impl Address {
pub fn new(email: impl Into<String>) -> Self {
Self {
name: None,
email: email.into(),
}
}
pub fn with_name(mut self, name: impl Into<String>) -> Self {
self.name = Some(name.into());
self
}
}