From 2639cc9f2d454870519d78c9e2da20b3e37652f9 Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Wed, 7 Aug 2024 21:19:21 +0100 Subject: [PATCH] clippy fix --- lapce-app/src/app.rs | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/lapce-app/src/app.rs b/lapce-app/src/app.rs index 4d06464808..d8d161cda9 100644 --- a/lapce-app/src/app.rs +++ b/lapce-app/src/app.rs @@ -228,8 +228,10 @@ impl AppData { } else { config }; - let mut workspace = LapceWorkspace::default(); - workspace.path = folder; + let workspace = LapceWorkspace { + path: folder, + ..Default::default() + }; let app_data = self.clone(); floem::new_window( move |window_id| { @@ -601,20 +603,20 @@ impl AppData { app_command.send(AppCommand::NewWindow { folder: Some(file.path.clone()), }); - } else { - if let Some(win_tab_data) = window_data.active_window_tab() { - win_tab_data.common.internal_command.send( - InternalCommand::GoToLocation { - location: EditorLocation { - path: file.path.clone(), - position: None, - scroll_offset: None, - ignore_unconfirmed: false, - same_editor_tab: false, - }, + } else if let Some(win_tab_data) = + window_data.active_window_tab() + { + win_tab_data.common.internal_command.send( + InternalCommand::GoToLocation { + location: EditorLocation { + path: file.path.clone(), + position: None, + scroll_offset: None, + ignore_unconfirmed: false, + same_editor_tab: false, }, - ) - } + }, + ) } } })