Fix a bunch of other low-hanging style lints (#36498)

- **Fix a bunch of low hanging style lints like unnecessary-return**
- **Fix single worktree violation**
- **And the rest**

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-08-19 21:26:17 +02:00 committed by GitHub
parent df9c2aefb1
commit 05fc0c432c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
239 changed files with 854 additions and 1015 deletions

View file

@ -552,9 +552,9 @@ impl Pane {
// to the item, and `focus_handle.contains_focus` returns false because the `active_item`
// is not hooked up to us in the dispatch tree.
self.focus_handle.contains_focused(window, cx)
|| self.active_item().map_or(false, |item| {
item.item_focus_handle(cx).contains_focused(window, cx)
})
|| self
.active_item()
.is_some_and(|item| item.item_focus_handle(cx).contains_focused(window, cx))
}
fn focus_in(&mut self, window: &mut Window, cx: &mut Context<Self>) {
@ -1021,7 +1021,7 @@ impl Pane {
existing_item
.project_entry_ids(cx)
.first()
.map_or(false, |existing_entry_id| {
.is_some_and(|existing_entry_id| {
Some(existing_entry_id) == project_entry_id.as_ref()
})
} else {
@ -1558,7 +1558,7 @@ impl Pane {
let other_project_item_ids = open_item.project_item_model_ids(cx);
dirty_project_item_ids.retain(|id| !other_project_item_ids.contains(id));
}
return dirty_project_item_ids.is_empty();
dirty_project_item_ids.is_empty()
}
pub(super) fn file_names_for_prompt(
@ -2745,7 +2745,7 @@ impl Pane {
worktree
.read(cx)
.root_entry()
.map_or(false, |entry| entry.is_dir())
.is_some_and(|entry| entry.is_dir())
});
let entry_abs_path = pane.read(cx).entry_abs_path(entry, cx);
@ -3210,8 +3210,7 @@ impl Pane {
return;
};
if target.map_or(false, |target| this.is_tab_pinned(target))
{
if target.is_some_and(|target| this.is_tab_pinned(target)) {
this.pin_tab_at(index, window, cx);
}
})
@ -3615,7 +3614,6 @@ impl Render for Pane {
)
.on_action(cx.listener(|_, _: &menu::Cancel, window, cx| {
if cx.stop_active_drag(window) {
return;
} else {
cx.propagate();
}