Remove expect followed by function call

This commit is contained in:
Robert Dodd 2024-01-03 08:55:09 +11:00
parent d928ee93b7
commit b1239dbd2a

View file

@ -210,9 +210,7 @@ pub fn set_attribute(
} }
fn parse_color(hex: &str) -> Color { fn parse_color(hex: &str) -> Color {
Color::hex(hex).expect(&format!( Color::hex(hex).unwrap_or_else(|_| panic!("Encountered invalid bevy_dioxus Color hex `{hex}`."))
"Encountered invalid bevy_dioxus Color hex `{hex}`."
))
} }
fn parse_f32(float: &str) -> f32 { fn parse_f32(float: &str) -> f32 {