From b1239dbd2a4b608796c186f1683cdb2f96588dc4 Mon Sep 17 00:00:00 2001 From: Robert Dodd Date: Wed, 3 Jan 2024 08:55:09 +1100 Subject: [PATCH] Remove expect followed by function call --- src/parse_attributes.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/parse_attributes.rs b/src/parse_attributes.rs index 9519757..6bd0f1a 100644 --- a/src/parse_attributes.rs +++ b/src/parse_attributes.rs @@ -210,9 +210,7 @@ pub fn set_attribute( } fn parse_color(hex: &str) -> Color { - Color::hex(hex).expect(&format!( - "Encountered invalid bevy_dioxus Color hex `{hex}`." - )) + Color::hex(hex).unwrap_or_else(|_| panic!("Encountered invalid bevy_dioxus Color hex `{hex}`.")) } fn parse_f32(float: &str) -> f32 {