From 3f0892368bcf475fdae39f24ef51b82b3013535f Mon Sep 17 00:00:00 2001 From: jelemux Date: Thu, 28 Jan 2021 17:41:49 +0100 Subject: try to fix problem with vcard mutable references --- src/viewmodel/telephone.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/viewmodel/telephone.rs') 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 for Telephon }, ] } - fn to_vcard_property(&self) -> Result { + fn is_empty(&self) -> bool { + self.number.is_empty() && + self.extension.is_empty() + } + fn to_vcard_property(&self) -> Result { // TODO error handling let mut telephone = properties::Telephone::from_telephone_value( values::telephone_value::TelephoneValue::from_telephone_number_str( self.number.clone(), -- cgit v1.2.3