From 036a567bae8346eb38f9237f59645dbcc4f1cd8c Mon Sep 17 00:00:00 2001 From: jelemux Date: Tue, 9 Feb 2021 23:18:45 +0100 Subject: switch to cargo-make; format files with rustfmt --- src/view/mod.rs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src/view/mod.rs') diff --git a/src/view/mod.rs b/src/view/mod.rs index 0751c53..cbff0fd 100644 --- a/src/view/mod.rs +++ b/src/view/mod.rs @@ -1,27 +1,30 @@ -use yew::prelude::*; +use crate::viewmodel::*; use std::cell::RefCell; use std::ops::Deref; use std::rc::Rc; -use crate::viewmodel::*; +use yew::prelude::*; -pub mod main; -pub mod name; pub mod address; -pub mod telephone; pub mod dates; +pub mod main; +pub mod name; pub mod organizational; +pub mod telephone; #[derive(Clone, PartialEq, Properties)] -pub struct InputProps - where O: VCardPropertyInputObject + Clone, - C: VCardPropertyInputComponent + Clone +pub struct InputProps +where + O: VCardPropertyInputObject + Clone, + C: VCardPropertyInputComponent + Clone, { pub generated: Callback, pub weak_link: WeakComponentLink, } /// Trait for types that represent an input component for a vcard property. -pub trait VCardPropertyInputComponent>: Component + Clone + PartialEq { +pub trait VCardPropertyInputComponent>: + Component + Clone + PartialEq +{ /// Returns the object containing the input data. fn get_input_object(&self) -> T; /// Getter function for the title of the component @@ -30,7 +33,7 @@ pub trait VCardPropertyInputComponent>: Compon fn get_error(&self) -> Option; /// Returns the error as `Html` fn render_error(&self) -> Html { - html!{ + html! { <> { if self.get_error().is_some() { @@ -75,4 +78,4 @@ impl PartialEq for WeakComponentLink { fn eq(&self, other: &Self) -> bool { Rc::ptr_eq(&self.0, &other.0) } -} \ No newline at end of file +} -- cgit v1.2.3