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

@ -257,7 +257,7 @@ impl DebugPanel {
.as_ref()
.map(|entity| entity.downgrade()),
task_context: task_context.clone(),
worktree_id: worktree_id,
worktree_id,
});
};
running.resolve_scenario(

View file

@ -87,7 +87,7 @@ impl DebugSession {
self.stack_trace_view.get_or_init(|| {
let stackframe_list = running_state.read(cx).stack_frame_list().clone();
let stack_frame_view = cx.new(|cx| {
cx.new(|cx| {
StackTraceView::new(
workspace.clone(),
project.clone(),
@ -95,9 +95,7 @@ impl DebugSession {
window,
cx,
)
});
stack_frame_view
})
})
}

View file

@ -358,7 +358,7 @@ pub(crate) fn new_debugger_pane(
}
};
let ret = cx.new(move |cx| {
cx.new(move |cx| {
let mut pane = Pane::new(
workspace.clone(),
project.clone(),
@ -562,9 +562,7 @@ pub(crate) fn new_debugger_pane(
}
});
pane
});
ret
})
}
pub struct DebugTerminal {

View file

@ -329,8 +329,8 @@ impl BreakpointList {
let text = self.input.read(cx).text(cx);
match mode {
ActiveBreakpointStripMode::Log => match &entry.kind {
BreakpointEntryKind::LineBreakpoint(line_breakpoint) => {
ActiveBreakpointStripMode::Log => {
if let BreakpointEntryKind::LineBreakpoint(line_breakpoint) = &entry.kind {
Self::edit_line_breakpoint_inner(
&self.breakpoint_store,
line_breakpoint.breakpoint.path.clone(),
@ -339,10 +339,9 @@ impl BreakpointList {
cx,
);
}
_ => {}
},
ActiveBreakpointStripMode::Condition => match &entry.kind {
BreakpointEntryKind::LineBreakpoint(line_breakpoint) => {
}
ActiveBreakpointStripMode::Condition => {
if let BreakpointEntryKind::LineBreakpoint(line_breakpoint) = &entry.kind {
Self::edit_line_breakpoint_inner(
&self.breakpoint_store,
line_breakpoint.breakpoint.path.clone(),
@ -351,10 +350,9 @@ impl BreakpointList {
cx,
);
}
_ => {}
},
ActiveBreakpointStripMode::HitCondition => match &entry.kind {
BreakpointEntryKind::LineBreakpoint(line_breakpoint) => {
}
ActiveBreakpointStripMode::HitCondition => {
if let BreakpointEntryKind::LineBreakpoint(line_breakpoint) = &entry.kind {
Self::edit_line_breakpoint_inner(
&self.breakpoint_store,
line_breakpoint.breakpoint.path.clone(),
@ -363,8 +361,7 @@ impl BreakpointList {
cx,
);
}
_ => {}
},
}
}
self.focus_handle.focus(window);
} else {
@ -426,13 +423,10 @@ impl BreakpointList {
return;
};
match &mut entry.kind {
BreakpointEntryKind::LineBreakpoint(line_breakpoint) => {
let path = line_breakpoint.breakpoint.path.clone();
let row = line_breakpoint.breakpoint.row;
self.edit_line_breakpoint(path, row, BreakpointEditAction::Toggle, cx);
}
_ => {}
if let BreakpointEntryKind::LineBreakpoint(line_breakpoint) = &mut entry.kind {
let path = line_breakpoint.breakpoint.path.clone();
let row = line_breakpoint.breakpoint.row;
self.edit_line_breakpoint(path, row, BreakpointEditAction::Toggle, cx);
}
cx.notify();
}
@ -967,7 +961,7 @@ impl LineBreakpoint {
props,
breakpoint: BreakpointEntry {
kind: BreakpointEntryKind::LineBreakpoint(self.clone()),
weak: weak,
weak,
},
is_selected,
focus_handle,
@ -1179,7 +1173,7 @@ impl ExceptionBreakpoint {
props,
breakpoint: BreakpointEntry {
kind: BreakpointEntryKind::ExceptionBreakpoint(self.clone()),
weak: weak,
weak,
},
is_selected,
focus_handle,

View file

@ -947,7 +947,7 @@ impl VariableList {
#[track_caller]
#[cfg(test)]
pub(crate) fn assert_visual_entries(&self, expected: Vec<&str>) {
const INDENT: &'static str = " ";
const INDENT: &str = " ";
let entries = &self.entries;
let mut visual_entries = Vec::with_capacity(entries.len());

View file

@ -1445,11 +1445,8 @@ async fn test_variable_list_only_sends_requests_when_rendering(
cx.run_until_parked();
let running_state = active_debug_session_panel(workspace, cx).update_in(cx, |item, _, _| {
let state = item.running_state().clone();
state
});
let running_state = active_debug_session_panel(workspace, cx)
.update_in(cx, |item, _, _| item.running_state().clone());
client
.fake_event(dap::messages::Events::Stopped(dap::StoppedEvent {