Don't clone panel kind list in show_panel
@@ -1425,11 +1425,10 @@ fn hide_panel(&mut self, ctx: &mut EventCtx, kind: PanelKind) {
fn show_panel(&mut self, ctx: &mut EventCtx, kind: PanelKind) {
for (_, panel) in self.panels.iter_mut() {
- for k in panel.widgets.clone() {
- if k == kind {
+ if panel.widgets.contains(&kind) {
let panel = Arc::make_mut(panel);
panel.shown = true;
- panel.active = k;
+ panel.active = kind;
let focus_id = match kind {
PanelKind::FileExplorer => self.file_explorer.widget_id,
PanelKind::SourceControl => self.source_control.active,
@@ -1447,7 +1446,6 @@ fn show_panel(&mut self, ctx: &mut EventCtx, kind: PanelKind) {
}
}
}
- }
fn toggle_panel(&mut self, ctx: &mut EventCtx, kind: PanelKind) {
if self.focus_area == FocusArea::Panel(kind) {
