chore: Fix clippy::needless_borrow up to an editor

This commit is contained in:
Piotr Osiewicz
2024-01-21 15:03:24 +01:00
parent c3102feeeb
commit 6c82380232
29 changed files with 86 additions and 88 deletions
+1 -1
View File
@@ -2054,7 +2054,7 @@ fn dirty_message_for(buffer_path: Option<ProjectPath>) -> String {
let path = buffer_path
.as_ref()
.and_then(|p| p.path.to_str())
.unwrap_or(&"This buffer");
.unwrap_or("This buffer");
let path = truncate_and_remove_front(path, 80);
format!("{path} contains unsaved edits. Do you want to save it?")
}
+1 -1
View File
@@ -591,7 +591,7 @@ impl WorkspaceDb {
Ok(())
}
SerializedPaneGroup::Pane(pane) => {
Self::save_pane(conn, workspace_id, &pane, parent)?;
Self::save_pane(conn, workspace_id, pane, parent)?;
Ok(())
}
}
+3 -3
View File
@@ -728,7 +728,7 @@ impl Workspace {
cx.spawn(|mut cx| async move {
let serialized_workspace: Option<SerializedWorkspace> =
persistence::DB.workspace_for_roots(&abs_paths.as_slice());
persistence::DB.workspace_for_roots(abs_paths.as_slice());
let paths_to_open = Arc::new(abs_paths);
@@ -3034,7 +3034,7 @@ impl Workspace {
flexes: Some(flexes.lock().clone()),
},
Member::Pane(pane_handle) => {
SerializedPaneGroup::Pane(serialize_pane_handle(&pane_handle, cx))
SerializedPaneGroup::Pane(serialize_pane_handle(pane_handle, cx))
}
}
}
@@ -4228,7 +4228,7 @@ pub fn restart(_: &Restart, cx: &mut AppContext) {
// If multiple windows have unsaved changes, and need a save prompt,
// prompt in the active window before switching to a different window.
workspace_windows.sort_by_key(|window| window.is_active(&cx) == Some(false));
workspace_windows.sort_by_key(|window| window.is_active(cx) == Some(false));
let mut prompt = None;
if let (true, Some(window)) = (should_confirm, workspace_windows.first()) {