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

@ -243,14 +243,14 @@ impl FocusId {
pub fn contains_focused(&self, window: &Window, cx: &App) -> bool {
window
.focused(cx)
.map_or(false, |focused| self.contains(focused.id, window))
.is_some_and(|focused| self.contains(focused.id, window))
}
/// Obtains whether the element associated with this handle is contained within the
/// focused element or is itself focused.
pub fn within_focused(&self, window: &Window, cx: &App) -> bool {
let focused = window.focused(cx);
focused.map_or(false, |focused| focused.id.contains(*self, window))
focused.is_some_and(|focused| focused.id.contains(*self, window))
}
/// Obtains whether this handle contains the given handle in the most recently rendered frame.
@ -504,7 +504,7 @@ impl HitboxId {
return true;
}
}
return false;
false
}
/// Checks if the hitbox with this ID contains the mouse and should handle scroll events.
@ -634,7 +634,7 @@ impl TooltipId {
window
.tooltip_bounds
.as_ref()
.map_or(false, |tooltip_bounds| {
.is_some_and(|tooltip_bounds| {
tooltip_bounds.id == *self
&& tooltip_bounds.bounds.contains(&window.mouse_position())
})
@ -4466,7 +4466,7 @@ impl Window {
}
}
}
return None;
None
}
}