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/viewmodel/name.rs | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'src/viewmodel/name.rs') diff --git a/src/viewmodel/name.rs b/src/viewmodel/name.rs index ee4736f..de0aa81 100644 --- a/src/viewmodel/name.rs +++ b/src/viewmodel/name.rs @@ -2,7 +2,7 @@ use super::*; use crate::view::name::*; /// Type that represents a vcard `name` property -/// +/// /// # Examples /// ``` /// # use bcard_wasm_webapp::viewmodel::name::Name; @@ -13,7 +13,7 @@ use crate::view::name::*; /// name.middle_name = String::from("Charles"); /// name.last_name = String::from("Clarke"); /// name.suffix = String::from("CBE FRAS"); -/// +/// /// assert_eq!(name.generate_fn(), String::from("Sir Arthur Charles Clarke, CBE FRAS")); /// ``` #[derive(Clone, Debug, PartialEq)] @@ -35,10 +35,13 @@ impl VCardPropertyInputObject for Name { suffix: String::new(), } } - fn get_input_fields(&self, link: &ComponentLink) -> std::vec::Vec { + fn get_input_fields( + &self, + link: &ComponentLink, + ) -> std::vec::Vec { let typ = String::from("text"); vec![ - VCardPropertyInputField::Text{ + VCardPropertyInputField::Text { label: "Prefix".to_string(), id: Some("prefix".to_string()), placeholder: Some("Sir".to_string()), @@ -46,7 +49,7 @@ impl VCardPropertyInputObject for Name { value: self.prefix.clone(), typ: typ.clone(), }, - VCardPropertyInputField::Text{ + VCardPropertyInputField::Text { label: "First Name".to_string(), id: Some("first_name".to_string()), placeholder: Some("Arthur".to_string()), @@ -54,7 +57,7 @@ impl VCardPropertyInputObject for Name { value: self.first_name.clone(), typ: typ.clone(), }, - VCardPropertyInputField::Text{ + VCardPropertyInputField::Text { label: "Middle Name".to_string(), id: Some("middle_name".to_string()), placeholder: Some("Charles".to_string()), @@ -62,7 +65,7 @@ impl VCardPropertyInputObject for Name { value: self.middle_name.clone(), typ: typ.clone(), }, - VCardPropertyInputField::Text{ + VCardPropertyInputField::Text { label: "Last Name".to_string(), id: Some("last_name".to_string()), placeholder: Some("Clarke".to_string()), @@ -70,7 +73,7 @@ impl VCardPropertyInputObject for Name { value: self.last_name.clone(), typ: typ.clone(), }, - VCardPropertyInputField::Text{ + VCardPropertyInputField::Text { label: "Suffix".to_string(), id: Some("suffix".to_string()), placeholder: Some("CBE FRAS".to_string()), @@ -81,11 +84,11 @@ impl VCardPropertyInputObject for Name { ] } fn is_empty(&self) -> bool { - self.prefix.is_empty() && - self.first_name.is_empty() && - self.middle_name.is_empty() && - self.last_name.is_empty() && - self.suffix.is_empty() + self.prefix.is_empty() + && self.first_name.is_empty() + && self.middle_name.is_empty() + && self.last_name.is_empty() + && self.suffix.is_empty() } } @@ -113,4 +116,4 @@ impl Name { full_name } -} \ No newline at end of file +} -- cgit v1.2.3