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
1 changed files with 1 additions and 3 deletions

View File

@ -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 {