Auto-fix clippy::collapsible_if violations (#36428)
Release Notes: - N/A
This commit is contained in:
parent
9e8ec72bd5
commit
8f567383e4
281 changed files with 6628 additions and 7089 deletions
|
@ -530,10 +530,9 @@ impl DebugPanel {
|
|||
.active_session
|
||||
.as_ref()
|
||||
.map(|session| session.entity_id())
|
||||
&& active_session_id == entity_id
|
||||
{
|
||||
if active_session_id == entity_id {
|
||||
this.active_session = this.sessions_with_children.keys().next().cloned();
|
||||
}
|
||||
this.active_session = this.sessions_with_children.keys().next().cloned();
|
||||
}
|
||||
cx.notify()
|
||||
})
|
||||
|
@ -1302,10 +1301,10 @@ impl DebugPanel {
|
|||
cx: &mut Context<'_, Self>,
|
||||
) -> Option<SharedString> {
|
||||
let adapter = parent_session.read(cx).adapter();
|
||||
if let Some(adapter) = DapRegistry::global(cx).adapter(&adapter) {
|
||||
if let Some(label) = adapter.label_for_child_session(request) {
|
||||
return Some(label.into());
|
||||
}
|
||||
if let Some(adapter) = DapRegistry::global(cx).adapter(&adapter)
|
||||
&& let Some(label) = adapter.label_for_child_session(request)
|
||||
{
|
||||
return Some(label.into());
|
||||
}
|
||||
None
|
||||
}
|
||||
|
|
|
@ -343,10 +343,10 @@ impl NewProcessModal {
|
|||
return;
|
||||
}
|
||||
|
||||
if let NewProcessMode::Launch = &self.mode {
|
||||
if self.configure_mode.read(cx).save_to_debug_json.selected() {
|
||||
self.save_debug_scenario(window, cx);
|
||||
}
|
||||
if let NewProcessMode::Launch = &self.mode
|
||||
&& self.configure_mode.read(cx).save_to_debug_json.selected()
|
||||
{
|
||||
self.save_debug_scenario(window, cx);
|
||||
}
|
||||
|
||||
let Some(debugger) = self.debugger.clone() else {
|
||||
|
|
|
@ -239,11 +239,9 @@ impl BreakpointList {
|
|||
}
|
||||
|
||||
fn select_next(&mut self, _: &menu::SelectNext, window: &mut Window, cx: &mut Context<Self>) {
|
||||
if self.strip_mode.is_some() {
|
||||
if self.input.focus_handle(cx).contains_focused(window, cx) {
|
||||
cx.propagate();
|
||||
return;
|
||||
}
|
||||
if self.strip_mode.is_some() && self.input.focus_handle(cx).contains_focused(window, cx) {
|
||||
cx.propagate();
|
||||
return;
|
||||
}
|
||||
let ix = match self.selected_ix {
|
||||
_ if self.breakpoints.len() == 0 => None,
|
||||
|
@ -265,11 +263,9 @@ impl BreakpointList {
|
|||
window: &mut Window,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
if self.strip_mode.is_some() {
|
||||
if self.input.focus_handle(cx).contains_focused(window, cx) {
|
||||
cx.propagate();
|
||||
return;
|
||||
}
|
||||
if self.strip_mode.is_some() && self.input.focus_handle(cx).contains_focused(window, cx) {
|
||||
cx.propagate();
|
||||
return;
|
||||
}
|
||||
let ix = match self.selected_ix {
|
||||
_ if self.breakpoints.len() == 0 => None,
|
||||
|
@ -286,11 +282,9 @@ impl BreakpointList {
|
|||
}
|
||||
|
||||
fn select_first(&mut self, _: &menu::SelectFirst, window: &mut Window, cx: &mut Context<Self>) {
|
||||
if self.strip_mode.is_some() {
|
||||
if self.input.focus_handle(cx).contains_focused(window, cx) {
|
||||
cx.propagate();
|
||||
return;
|
||||
}
|
||||
if self.strip_mode.is_some() && self.input.focus_handle(cx).contains_focused(window, cx) {
|
||||
cx.propagate();
|
||||
return;
|
||||
}
|
||||
let ix = if self.breakpoints.len() > 0 {
|
||||
Some(0)
|
||||
|
@ -301,11 +295,9 @@ impl BreakpointList {
|
|||
}
|
||||
|
||||
fn select_last(&mut self, _: &menu::SelectLast, window: &mut Window, cx: &mut Context<Self>) {
|
||||
if self.strip_mode.is_some() {
|
||||
if self.input.focus_handle(cx).contains_focused(window, cx) {
|
||||
cx.propagate();
|
||||
return;
|
||||
}
|
||||
if self.strip_mode.is_some() && self.input.focus_handle(cx).contains_focused(window, cx) {
|
||||
cx.propagate();
|
||||
return;
|
||||
}
|
||||
let ix = if self.breakpoints.len() > 0 {
|
||||
Some(self.breakpoints.len() - 1)
|
||||
|
@ -401,11 +393,9 @@ impl BreakpointList {
|
|||
let Some(entry) = self.selected_ix.and_then(|ix| self.breakpoints.get_mut(ix)) else {
|
||||
return;
|
||||
};
|
||||
if self.strip_mode.is_some() {
|
||||
if self.input.focus_handle(cx).contains_focused(window, cx) {
|
||||
cx.propagate();
|
||||
return;
|
||||
}
|
||||
if self.strip_mode.is_some() && self.input.focus_handle(cx).contains_focused(window, cx) {
|
||||
cx.propagate();
|
||||
return;
|
||||
}
|
||||
|
||||
match &mut entry.kind {
|
||||
|
|
|
@ -611,17 +611,16 @@ impl ConsoleQueryBarCompletionProvider {
|
|||
for variable in console.variable_list.update(cx, |variable_list, cx| {
|
||||
variable_list.completion_variables(cx)
|
||||
}) {
|
||||
if let Some(evaluate_name) = &variable.evaluate_name {
|
||||
if variables
|
||||
if let Some(evaluate_name) = &variable.evaluate_name
|
||||
&& variables
|
||||
.insert(evaluate_name.clone(), variable.value.clone())
|
||||
.is_none()
|
||||
{
|
||||
string_matches.push(StringMatchCandidate {
|
||||
id: 0,
|
||||
string: evaluate_name.clone(),
|
||||
char_bag: evaluate_name.chars().collect(),
|
||||
});
|
||||
}
|
||||
{
|
||||
string_matches.push(StringMatchCandidate {
|
||||
id: 0,
|
||||
string: evaluate_name.clone(),
|
||||
char_bag: evaluate_name.chars().collect(),
|
||||
});
|
||||
}
|
||||
|
||||
if variables
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue