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| {
if ui
.add(Button::new("Panel"))
.on_hover_text(if self.settings.show_side_panel {
"Hide Side Panel"
} else {
"Show Side Panel"
.on_hover_text(match self.settings.show_side_panel {
true => "Hide Side Panel",
false => "Show Side Panel",
})
.clicked()
{