Another batch of lint fixes (#36521)

- **Enable a bunch of extra lints**
- **First batch of fixes**
- **More fixes**

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-08-19 22:33:44 +02:00 committed by GitHub
parent 69b1c6d6f5
commit 6825715503
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
147 changed files with 788 additions and 1042 deletions

View file

@ -123,7 +123,7 @@ impl FileDiffView {
old_buffer,
new_buffer,
_recalculate_diff_task: cx.spawn(async move |this, cx| {
while let Ok(_) = buffer_changes_rx.recv().await {
while buffer_changes_rx.recv().await.is_ok() {
loop {
let mut timer = cx
.background_executor()

View file

@ -426,7 +426,7 @@ impl GitPanel {
let git_store = project.read(cx).git_store().clone();
let active_repository = project.read(cx).active_repository(cx);
let git_panel = cx.new(|cx| {
cx.new(|cx| {
let focus_handle = cx.focus_handle();
cx.on_focus(&focus_handle, window, Self::focus_in).detach();
cx.on_focus_out(&focus_handle, window, |this, _, window, cx| {
@ -563,9 +563,7 @@ impl GitPanel {
this.schedule_update(false, window, cx);
this
});
git_panel
})
}
fn hide_scrollbars(&mut self, window: &mut Window, cx: &mut Context<Self>) {
@ -1198,14 +1196,13 @@ impl GitPanel {
window,
cx,
);
cx.spawn(async move |this, cx| match prompt.await {
Ok(RestoreCancel::RestoreTrackedFiles) => {
cx.spawn(async move |this, cx| {
if let Ok(RestoreCancel::RestoreTrackedFiles) = prompt.await {
this.update(cx, |this, cx| {
this.perform_checkout(entries, cx);
})
.ok();
}
_ => {}
})
.detach();
}

View file

@ -346,22 +346,19 @@ impl ProjectDiff {
window: &mut Window,
cx: &mut Context<Self>,
) {
match event {
EditorEvent::SelectionsChanged { local: true } => {
let Some(project_path) = self.active_path(cx) else {
return;
};
self.workspace
.update(cx, |workspace, cx| {
if let Some(git_panel) = workspace.panel::<GitPanel>(cx) {
git_panel.update(cx, |git_panel, cx| {
git_panel.select_entry_by_path(project_path, window, cx)
})
}
})
.ok();
}
_ => {}
if let EditorEvent::SelectionsChanged { local: true } = event {
let Some(project_path) = self.active_path(cx) else {
return;
};
self.workspace
.update(cx, |workspace, cx| {
if let Some(git_panel) = workspace.panel::<GitPanel>(cx) {
git_panel.update(cx, |git_panel, cx| {
git_panel.select_entry_by_path(project_path, window, cx)
})
}
})
.ok();
}
if editor.focus_handle(cx).contains_focused(window, cx)
&& self.multibuffer.read(cx).is_empty()
@ -513,7 +510,7 @@ impl ProjectDiff {
mut recv: postage::watch::Receiver<()>,
cx: &mut AsyncWindowContext,
) -> Result<()> {
while let Some(_) = recv.next().await {
while (recv.next().await).is_some() {
let buffers_to_load = this.update(cx, |this, cx| this.load_buffers(cx))?;
for buffer_to_load in buffers_to_load {
if let Some(buffer) = buffer_to_load.await.log_err() {

View file

@ -207,7 +207,7 @@ impl TextDiffView {
path: Some(format!("Clipboard ↔ {selection_location_path}").into()),
buffer_changes_tx,
_recalculate_diff_task: cx.spawn(async move |_, cx| {
while let Ok(_) = buffer_changes_rx.recv().await {
while buffer_changes_rx.recv().await.is_ok() {
loop {
let mut timer = cx
.background_executor()