diff options
Diffstat (limited to 'src/view/telephone.rs')
-rw-r--r-- | src/view/telephone.rs | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/view/telephone.rs b/src/view/telephone.rs index a47c610..26d7806 100644 --- a/src/view/telephone.rs +++ b/src/view/telephone.rs @@ -1,7 +1,6 @@ use crate::view::WeakComponentLink; use crate::viewmodel::Error; use yew::prelude::*; -use vcard::properties; use crate::viewmodel::telephone::*; use crate::viewmodel::VCardPropertyInputObject; use super::VCardPropertyInputComponent; @@ -30,11 +29,11 @@ pub enum Msg { #[derive(Clone, PartialEq, Properties)] pub struct Props { - pub generated: Callback<Result<properties::Telephone,()>>, + pub generated: Callback<Telephone>, pub weak_link: WeakComponentLink<TelephoneView>, } -impl VCardPropertyInputComponent<properties::Telephone, Telephone> for TelephoneView { +impl VCardPropertyInputComponent<Telephone> for TelephoneView { fn get_input_object(&self) -> Telephone { self.value.clone() } @@ -71,16 +70,7 @@ impl Component for TelephoneView { Msg::TogglePager => self.value.pager = !self.value.pager, Msg::ToggleTextPhone => self.value.text_phone = !self.value.text_phone, Msg::Generate => { - match self.value.to_vcard_property() { - Ok(telephone) => { - self.props.generated.emit(Ok(telephone)); - return false; - }, - Err(error) => { - self.props.generated.emit(Err(())); - self.error = Some(error); - }, - }; + self.props.generated.emit(self.value); } }; true |