diff options
author | jelemux <jeremias.weber@protonmail.com> | 2021-01-28 17:41:49 +0100 |
---|---|---|
committer | jelemux <jeremias.weber@protonmail.com> | 2021-01-28 17:41:49 +0100 |
commit | 3f0892368bcf475fdae39f24ef51b82b3013535f (patch) | |
tree | 087a0869e618cc37b48e6d462c99bc1b289ddabf /src/viewmodel/address.rs | |
parent | 4a0c73eebb8dfd6a5543945049175f64b9817c96 (diff) | |
download | wasm-card-3f0892368bcf475fdae39f24ef51b82b3013535f.tar.gz wasm-card-3f0892368bcf475fdae39f24ef51b82b3013535f.tar.bz2 |
try to fix problem with vcard mutable references
Diffstat (limited to 'src/viewmodel/address.rs')
-rw-r--r-- | src/viewmodel/address.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/viewmodel/address.rs b/src/viewmodel/address.rs index 757236c..b2257bf 100644 --- a/src/viewmodel/address.rs +++ b/src/viewmodel/address.rs @@ -97,7 +97,16 @@ impl VCardPropertyInputObject<properties::Address, AddressView> for Address { }, ] } - fn to_vcard_property(&self) -> Result<properties::Address, VCardPropertyInputError> { + fn is_empty(&self) -> bool { + self.post_office_box.is_empty() && + self.extension.is_empty() && + self.street.is_empty() && + self.locality.is_empty() && + self.region.is_empty() && + self.code.is_empty() && + self.country.is_empty() + } + fn to_vcard_property(&self) -> Result<properties::Address, Error> { // TODO error handling let address_value = values::address_value::AddressValue::from_components( match self.post_office_box.is_empty() { true => None, |