summaryrefslogtreecommitdiff
path: root/src/viewmodel/telephone.rs
diff options
context:
space:
mode:
authorjelemux <jeremias.weber@protonmail.com>2021-01-28 17:41:49 +0100
committerjelemux <jeremias.weber@protonmail.com>2021-01-28 17:41:49 +0100
commit3f0892368bcf475fdae39f24ef51b82b3013535f (patch)
tree087a0869e618cc37b48e6d462c99bc1b289ddabf /src/viewmodel/telephone.rs
parent4a0c73eebb8dfd6a5543945049175f64b9817c96 (diff)
downloadwasm-card-3f0892368bcf475fdae39f24ef51b82b3013535f.tar.gz
wasm-card-3f0892368bcf475fdae39f24ef51b82b3013535f.tar.bz2
try to fix problem with vcard mutable references
Diffstat (limited to 'src/viewmodel/telephone.rs')
-rw-r--r--src/viewmodel/telephone.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/viewmodel/telephone.rs b/src/viewmodel/telephone.rs
index b67b0fb..f90df5d 100644
--- a/src/viewmodel/telephone.rs
+++ b/src/viewmodel/telephone.rs
@@ -108,7 +108,11 @@ impl VCardPropertyInputObject<properties::Telephone, TelephoneView> for Telephon
},
]
}
- fn to_vcard_property(&self) -> Result<properties::Telephone, VCardPropertyInputError> {
+ fn is_empty(&self) -> bool {
+ self.number.is_empty() &&
+ self.extension.is_empty()
+ }
+ fn to_vcard_property(&self) -> Result<properties::Telephone, Error> { // TODO error handling
let mut telephone = properties::Telephone::from_telephone_value(
values::telephone_value::TelephoneValue::from_telephone_number_str(
self.number.clone(),