From 5d9d9e744167332bd90e8fca418a6af85d1c8e4a Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Mon, 17 Apr 2023 13:44:44 -0500 Subject: [PATCH] fix clippy --- packages/native-core/tests/custom_element.rs | 27 +++++++++----------- packages/rink/examples/widgets.rs | 13 ++++------ 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/packages/native-core/tests/custom_element.rs b/packages/native-core/tests/custom_element.rs index 935ac94d0..e875342d9 100644 --- a/packages/native-core/tests/custom_element.rs +++ b/packages/native-core/tests/custom_element.rs @@ -309,24 +309,21 @@ fn custom_elements_work() { let size = *node.get::().unwrap(); let id = node.id(); println!("{indent}{id:?} {color:?} {size:?} {node_type:?}"); - match node_type { - NodeType::Element(el) => { - match el.tag.as_str() { - // the color should bubble up from customelementslot - "testing132" | "customelementslot" => { - 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 let NodeType::Element(el) = node_type { + match el.tag.as_str() { + // the color should bubble up from customelementslot + "testing132" | "customelementslot" => { + assert_eq!(color.color, 1); } - if el.tag != "Root" { - assert_eq!(size.size, (i + 2).saturating_sub(height)); + // 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" { + assert_eq!(size.size, (i + 2).saturating_sub(height)); } - _ => {} } }); } diff --git a/packages/rink/examples/widgets.rs b/packages/rink/examples/widgets.rs index 1226d5c3d..b39a3b4c2 100644 --- a/packages/rink/examples/widgets.rs +++ b/packages/rink/examples/widgets.rs @@ -76,16 +76,13 @@ impl Driver for Counter { event: Rc, _: bool, ) { - match event_type { - "input" => { - // when the button is clicked, increment the counter - if let EventData::Form(input_event) = &*event { - if let Ok(value) = input_event.value.parse::() { - self.count = value; - } + if event_type == "input" { + // when the button is clicked, increment the counter + if let EventData::Form(input_event) = &*event { + if let Ok(value) = input_event.value.parse::() { + self.count = value; } } - _ => {} } }