use alloc::{borrow::Cow, vec::Vec};
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct VcardAdr<'a> {
pub po_box: Vec<Cow<'a, str>>,
pub extended: Vec<Cow<'a, str>>,
pub street: Vec<Cow<'a, str>>,
pub locality: Vec<Cow<'a, str>>,
pub region: Vec<Cow<'a, str>>,
pub postal_code: Vec<Cow<'a, str>>,
pub country: Vec<Cow<'a, str>>,
pub room: Vec<Cow<'a, str>>,
pub apartment: Vec<Cow<'a, str>>,
pub floor: Vec<Cow<'a, str>>,
pub street_number: Vec<Cow<'a, str>>,
pub street_name: Vec<Cow<'a, str>>,
pub building: Vec<Cow<'a, str>>,
pub block: Vec<Cow<'a, str>>,
pub subdistrict: Vec<Cow<'a, str>>,
pub district: Vec<Cow<'a, str>>,
pub landmark: Vec<Cow<'a, str>>,
pub direction: Vec<Cow<'a, str>>,
}
impl VcardAdr<'_> {
pub fn has_extended_components(&self) -> bool {
[
&self.room,
&self.apartment,
&self.floor,
&self.street_number,
&self.street_name,
&self.building,
&self.block,
&self.subdistrict,
&self.district,
&self.landmark,
&self.direction,
]
.into_iter()
.any(|component| component.iter().any(|value| !value.is_empty()))
}
}