use match instead of if statement

This commit is contained in:
Simon Gardling 2022-03-03 00:18:31 -05:00
parent c84a98f291
commit da091c8174

View File

@ -323,10 +323,9 @@ impl epi::App for MathApp {
ui.horizontal(|ui| { ui.horizontal(|ui| {
if ui if ui
.add(Button::new("Panel")) .add(Button::new("Panel"))
.on_hover_text(if self.settings.show_side_panel { .on_hover_text(match self.settings.show_side_panel {
"Hide Side Panel" true => "Hide Side Panel",
} else { false => "Show Side Panel",
"Show Side Panel"
}) })
.clicked() .clicked()
{ {