Skip to content

Commit 056918d

Browse files
committed
cargo fmt
1 parent 3ac5aa4 commit 056918d

File tree

4 files changed

+17
-30
lines changed

4 files changed

+17
-30
lines changed

crates/html-parser/src/lib.rs

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,21 @@ fn process_node<MSG>(node: &rphtml::parser::Node) -> Result<Option<Node<MSG>>, P
8585
.attrs
8686
.iter()
8787
.filter_map(|attr| {
88-
attr.key
89-
.as_ref()
90-
.and_then(|key| {
91-
let key = String::from_iter(key.content.iter());
92-
if let Some(attr_key) = lookup::match_attribute(&key) {
93-
let value = if let Some(value) = &attr.value {
94-
let value = String::from_iter(value.content.iter());
95-
AttributeValue::Simple(Value::from(value))
96-
} else {
97-
AttributeValue::Empty
98-
};
99-
Some(Attribute::new(None, attr_key, value))
88+
attr.key.as_ref().and_then(|key| {
89+
let key = String::from_iter(key.content.iter());
90+
if let Some(attr_key) = lookup::match_attribute(&key) {
91+
let value = if let Some(value) = &attr.value {
92+
let value = String::from_iter(value.content.iter());
93+
AttributeValue::Simple(Value::from(value))
10094
} else {
101-
log::warn!("Not a standard html attribute: {}", key);
102-
None
103-
}
104-
})
95+
AttributeValue::Empty
96+
};
97+
Some(Attribute::new(None, attr_key, value))
98+
} else {
99+
log::warn!("Not a standard html attribute: {}", key);
100+
None
101+
}
102+
})
105103
})
106104
.collect();
107105

examples/experimentals/src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//#![deny(warnings)]
22
use crate::button::{self, Button};
3-
use crate::date_time::{self, DateTimeWidget, date, time};
3+
use crate::date_time::{self, date, time, DateTimeWidget};
44
use js_sys::Date;
55
use sauron::dom::component;
66
use sauron::dom::stateful_component;

examples/experimentals/src/button.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,7 @@ impl Component for Button {
4848
}
4949

5050
impl StatefulComponent for Button {
51-
fn attribute_changed(
52-
&mut self,
53-
attr_name: &str,
54-
new_value: Vec<DomAttrValue>,
55-
)
56-
{
57-
}
51+
fn attribute_changed(&mut self, attr_name: &str, new_value: Vec<DomAttrValue>) {}
5852

5953
/// append a child into this component
6054
fn append_children(&mut self, children: Vec<DomNode>) {

examples/experimentals/src/date_time.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,7 @@ where
182182

183183
impl StatefulComponent for DateTimeWidget<()> {
184184
/// this is called when the attributes in the mount is changed
185-
fn attribute_changed(
186-
&mut self,
187-
attr_name: &str,
188-
new_value: Vec<DomAttrValue>,
189-
)
190-
{
185+
fn attribute_changed(&mut self, attr_name: &str, new_value: Vec<DomAttrValue>) {
191186
match &*attr_name {
192187
"time" => {
193188
if let Some(new_value) = new_value[0].as_string() {

0 commit comments

Comments
 (0)