diff options
author | jelemux <jeremias.weber@protonmail.com> | 2021-02-09 23:18:45 +0100 |
---|---|---|
committer | jelemux <jeremias.weber@protonmail.com> | 2021-02-09 23:18:45 +0100 |
commit | 036a567bae8346eb38f9237f59645dbcc4f1cd8c (patch) | |
tree | 21a86e3c5cb8964030c414718190af12f3d26125 /src/view/mod.rs | |
parent | 9df3ff8d633a18e934d4e62b0e2e718620760552 (diff) | |
download | wasm-card-036a567bae8346eb38f9237f59645dbcc4f1cd8c.tar.gz wasm-card-036a567bae8346eb38f9237f59645dbcc4f1cd8c.tar.bz2 |
switch to cargo-make; format files with rustfmt
Diffstat (limited to 'src/view/mod.rs')
-rw-r--r-- | src/view/mod.rs | 25 |
1 files changed, 14 insertions, 11 deletions
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<O, C> - where O: VCardPropertyInputObject<C> + Clone, - C: VCardPropertyInputComponent<O> + Clone +pub struct InputProps<O, C> +where + O: VCardPropertyInputObject<C> + Clone, + C: VCardPropertyInputComponent<O> + Clone, { pub generated: Callback<O>, pub weak_link: WeakComponentLink<C>, } /// Trait for types that represent an input component for a vcard property. -pub trait VCardPropertyInputComponent<T: VCardPropertyInputObject<Self>>: Component + Clone + PartialEq { +pub trait VCardPropertyInputComponent<T: VCardPropertyInputObject<Self>>: + 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<T: VCardPropertyInputObject<Self>>: Compon fn get_error(&self) -> Option<Error>; /// Returns the error as `Html` fn render_error(&self) -> Html { - html!{ + html! { <> { if self.get_error().is_some() { @@ -75,4 +78,4 @@ impl<COMP: Component> PartialEq for WeakComponentLink<COMP> { fn eq(&self, other: &Self) -> bool { Rc::ptr_eq(&self.0, &other.0) } -}
\ No newline at end of file +} |