summaryrefslogtreecommitdiff
path: root/src/view/address.rs
diff options
context:
space:
mode:
authorjelemux <jeremias.weber@protonmail.com>2021-02-09 23:18:45 +0100
committerjelemux <jeremias.weber@protonmail.com>2021-02-09 23:18:45 +0100
commit036a567bae8346eb38f9237f59645dbcc4f1cd8c (patch)
tree21a86e3c5cb8964030c414718190af12f3d26125 /src/view/address.rs
parent9df3ff8d633a18e934d4e62b0e2e718620760552 (diff)
downloadwasm-card-036a567bae8346eb38f9237f59645dbcc4f1cd8c.tar.gz
wasm-card-036a567bae8346eb38f9237f59645dbcc4f1cd8c.tar.bz2
switch to cargo-make; format files with rustfmt
Diffstat (limited to 'src/view/address.rs')
-rw-r--r--src/view/address.rs28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/view/address.rs b/src/view/address.rs
index a945272..57ea7e4 100644
--- a/src/view/address.rs
+++ b/src/view/address.rs
@@ -1,28 +1,28 @@
+use super::VCardPropertyInputComponent;
use crate::view::InputProps;
-use yew::prelude::*;
-use yewtil::NeqAssign;
use crate::viewmodel::address::*;
-use crate::viewmodel::VCardPropertyInputObject;
-use super::VCardPropertyInputComponent;
use crate::viewmodel::Error;
+use crate::viewmodel::VCardPropertyInputObject;
+use yew::prelude::*;
+use yewtil::NeqAssign;
-type Props = InputProps<Address,AddressView>;
+type Props = InputProps<Address, AddressView>;
/// View Component for a `address` field
-///
+///
/// # Examples
-///
+///
/// ```compile_fail
/// let html = html!{
-/// <AddressView weak_link=some_weak_component_link
+/// <AddressView weak_link=some_weak_component_link
/// generated=self.link.callback(
-/// |n: Irc<Address>|
+/// |n: Irc<Address>|
/// Msg::GeneratedAddress(some_address)
/// )
/// />
/// };
/// ```
-#[derive(Clone,PartialEq)]
+#[derive(Clone, PartialEq)]
pub struct AddressView {
props: Props,
value: Address,
@@ -79,17 +79,17 @@ impl Component for AddressView {
Msg::ToggleHome => self.value.home = !self.value.home,
Msg::Generate => {
self.props.generated.emit(self.value.clone());
- },
+ }
};
true
}
- fn change(&mut self, props: <Self as yew::Component>::Properties) -> bool {
+ fn change(&mut self, props: <Self as yew::Component>::Properties) -> bool {
self.props.neq_assign(props)
}
fn view(&self) -> yew::virtual_dom::VNode {
let link = self.props.weak_link.borrow().clone().unwrap();
- html!{
+ html! {
<div class="box">
{ self.render_error() }
@@ -100,4 +100,4 @@ impl Component for AddressView {
</div>
}
}
-} \ No newline at end of file
+}