Fix clippy::needless_borrow lint violations (#36444)
Release Notes: - N/A
This commit is contained in:
@@ -102,7 +102,7 @@ impl Render for RunningState {
|
||||
.find(|pane| pane.read(cx).is_zoomed());
|
||||
|
||||
let active = self.panes.panes().into_iter().next();
|
||||
let pane = if let Some(ref zoomed_pane) = zoomed_pane {
|
||||
let pane = if let Some(zoomed_pane) = zoomed_pane {
|
||||
zoomed_pane.update(cx, |pane, cx| pane.render(window, cx).into_any_element())
|
||||
} else if let Some(active) = active {
|
||||
self.panes
|
||||
@@ -627,7 +627,7 @@ impl RunningState {
|
||||
if s.starts_with("\"$ZED_") && s.ends_with('"') {
|
||||
*s = s[1..s.len() - 1].to_string();
|
||||
}
|
||||
if let Some(substituted) = substitute_variables_in_str(&s, context) {
|
||||
if let Some(substituted) = substitute_variables_in_str(s, context) {
|
||||
*s = substituted;
|
||||
}
|
||||
}
|
||||
@@ -657,7 +657,7 @@ impl RunningState {
|
||||
}
|
||||
resolve_path(s);
|
||||
|
||||
if let Some(substituted) = substitute_variables_in_str(&s, context) {
|
||||
if let Some(substituted) = substitute_variables_in_str(s, context) {
|
||||
*s = substituted;
|
||||
}
|
||||
}
|
||||
@@ -954,7 +954,7 @@ impl RunningState {
|
||||
inventory.read(cx).task_template_by_label(
|
||||
buffer,
|
||||
worktree_id,
|
||||
&label,
|
||||
label,
|
||||
cx,
|
||||
)
|
||||
})
|
||||
@@ -1310,7 +1310,7 @@ impl RunningState {
|
||||
let mut pane_item_status = IndexMap::from_iter(
|
||||
DebuggerPaneItem::all()
|
||||
.iter()
|
||||
.filter(|kind| kind.is_supported(&caps))
|
||||
.filter(|kind| kind.is_supported(caps))
|
||||
.map(|kind| (*kind, false)),
|
||||
);
|
||||
self.panes.panes().iter().for_each(|pane| {
|
||||
@@ -1371,7 +1371,7 @@ impl RunningState {
|
||||
this.serialize_layout(window, cx);
|
||||
match event {
|
||||
Event::Remove { .. } => {
|
||||
let _did_find_pane = this.panes.remove(&source_pane).is_ok();
|
||||
let _did_find_pane = this.panes.remove(source_pane).is_ok();
|
||||
debug_assert!(_did_find_pane);
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
@@ -494,7 +494,7 @@ impl BreakpointList {
|
||||
fn toggle_data_breakpoint(&mut self, id: &str, cx: &mut Context<Self>) {
|
||||
if let Some(session) = &self.session {
|
||||
session.update(cx, |this, cx| {
|
||||
this.toggle_data_breakpoint(&id, cx);
|
||||
this.toggle_data_breakpoint(id, cx);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -502,7 +502,7 @@ impl BreakpointList {
|
||||
fn toggle_exception_breakpoint(&mut self, id: &str, cx: &mut Context<Self>) {
|
||||
if let Some(session) = &self.session {
|
||||
session.update(cx, |this, cx| {
|
||||
this.toggle_exception_breakpoint(&id, cx);
|
||||
this.toggle_exception_breakpoint(id, cx);
|
||||
});
|
||||
cx.notify();
|
||||
const EXCEPTION_SERIALIZATION_INTERVAL: Duration = Duration::from_secs(1);
|
||||
|
||||
@@ -697,7 +697,7 @@ impl ConsoleQueryBarCompletionProvider {
|
||||
new_bytes: &[u8],
|
||||
snapshot: &TextBufferSnapshot,
|
||||
) -> Range<Anchor> {
|
||||
let buffer_offset = buffer_position.to_offset(&snapshot);
|
||||
let buffer_offset = buffer_position.to_offset(snapshot);
|
||||
let buffer_bytes = &buffer_text.as_bytes()[0..buffer_offset];
|
||||
|
||||
let mut prefix_len = 0;
|
||||
@@ -977,7 +977,7 @@ mod tests {
|
||||
&cx.buffer_text(),
|
||||
snapshot.anchor_before(buffer_position),
|
||||
replacement.as_bytes(),
|
||||
&snapshot,
|
||||
snapshot,
|
||||
);
|
||||
|
||||
cx.update_editor(|editor, _, cx| {
|
||||
|
||||
@@ -262,7 +262,7 @@ impl MemoryView {
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
use parse_int::parse;
|
||||
let Ok(as_address) = parse::<u64>(&memory_reference) else {
|
||||
let Ok(as_address) = parse::<u64>(memory_reference) else {
|
||||
return;
|
||||
};
|
||||
let access_size = evaluate_name
|
||||
@@ -931,7 +931,7 @@ impl Render for MemoryView {
|
||||
v_flex()
|
||||
.size_full()
|
||||
.on_drag_move(cx.listener(|this, evt, _, _| {
|
||||
this.handle_memory_drag(&evt);
|
||||
this.handle_memory_drag(evt);
|
||||
}))
|
||||
.child(self.render_memory(cx).size_full())
|
||||
.children(self.open_context_menu.as_ref().map(|(menu, position, _)| {
|
||||
|
||||
@@ -1289,7 +1289,7 @@ impl VariableList {
|
||||
}),
|
||||
)
|
||||
.child(self.render_variable_value(
|
||||
&entry,
|
||||
entry,
|
||||
&variable_color,
|
||||
watcher.value.to_string(),
|
||||
cx,
|
||||
@@ -1494,7 +1494,7 @@ impl VariableList {
|
||||
}),
|
||||
)
|
||||
.child(self.render_variable_value(
|
||||
&variable,
|
||||
variable,
|
||||
&variable_color,
|
||||
dap.value.clone(),
|
||||
cx,
|
||||
|
||||
Reference in New Issue
Block a user