fix clippy
This commit is contained in:
1 parent
9877b0f0b1
commit
5d9d9e7441
2 files changed
+17
-23
No files matched your search
@@ -309,24 +309,21 @@ fn custom_elements_work() {
|
|||||||
let size = *node.get::<LayoutState>().unwrap();
|
let size = *node.get::<LayoutState>().unwrap();
|
||||||
let id = node.id();
|
let id = node.id();
|
||||||
println!("{indent}{id:?} {color:?} {size:?} {node_type:?}");
|
println!("{indent}{id:?} {color:?} {size:?} {node_type:?}");
|
||||||
match node_type {
|
if let NodeType::Element(el) = node_type {
|
||||||
NodeType::Element(el) => {
|
match el.tag.as_str() {
|
||||||
match el.tag.as_str() {
|
// the color should bubble up from customelementslot
|
||||||
// the color should bubble up from customelementslot
|
"testing132" | "customelementslot" => {
|
||||||
"testing132" | "customelementslot" => {
|
assert_eq!(color.color, 1);
|
||||||
assert_eq!(color.color, 1);
|
|
||||||
}
|
|
||||||
// the color of the light dom should not effect the color of the shadow dom, so the color of divs in the shadow dom should be 0
|
|
||||||
"div" => {
|
|
||||||
assert_eq!(color.color, 0);
|
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
if el.tag != "Root" {
|
// the color of the light dom should not effect the color of the shadow dom, so the color of divs in the shadow dom should be 0
|
||||||
assert_eq!(size.size, (i + 2).saturating_sub(height));
|
"div" => {
|
||||||
|
assert_eq!(color.color, 0);
|
||||||
}
|
}
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
if el.tag != "Root" {
|
||||||
|
assert_eq!(size.size, (i + 2).saturating_sub(height));
|
||||||
}
|
}
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,16 +76,13 @@ impl Driver for Counter {
|
|||||||
event: Rc<EventData>,
|
event: Rc<EventData>,
|
||||||
_: bool,
|
_: bool,
|
||||||
) {
|
) {
|
||||||
match event_type {
|
if event_type == "input" {
|
||||||
"input" => {
|
// when the button is clicked, increment the counter
|
||||||
// when the button is clicked, increment the counter
|
if let EventData::Form(input_event) = &*event {
|
||||||
if let EventData::Form(input_event) = &*event {
|
if let Ok(value) = input_event.value.parse::<f64>() {
|
||||||
if let Ok(value) = input_event.value.parse::<f64>() {
|
self.count = value;
|
||||||
self.count = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user