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
|
@ -456,11 +456,11 @@ impl RulesLibrary {
|
|||
pub fn new_rule(&mut self, window: &mut Window, cx: &mut Context<Self>) {
|
||||
// If we already have an untitled rule, use that instead
|
||||
// of creating a new one.
|
||||
if let Some(metadata) = self.store.read(cx).first() {
|
||||
if metadata.title.is_none() {
|
||||
self.load_rule(metadata.id, true, window, cx);
|
||||
return;
|
||||
}
|
||||
if let Some(metadata) = self.store.read(cx).first()
|
||||
&& metadata.title.is_none()
|
||||
{
|
||||
self.load_rule(metadata.id, true, window, cx);
|
||||
return;
|
||||
}
|
||||
|
||||
let prompt_id = PromptId::new();
|
||||
|
@ -706,15 +706,13 @@ impl RulesLibrary {
|
|||
.map_or(true, |old_selected_prompt| {
|
||||
old_selected_prompt.id != prompt_id
|
||||
})
|
||||
{
|
||||
if let Some(ix) = picker
|
||||
&& let Some(ix) = picker
|
||||
.delegate
|
||||
.matches
|
||||
.iter()
|
||||
.position(|mat| mat.id == prompt_id)
|
||||
{
|
||||
picker.set_selected_index(ix, None, true, window, cx);
|
||||
}
|
||||
{
|
||||
picker.set_selected_index(ix, None, true, window, cx);
|
||||
}
|
||||
} else {
|
||||
picker.focus(window, cx);
|
||||
|
@ -869,10 +867,10 @@ impl RulesLibrary {
|
|||
window: &mut Window,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
if let Some(rule_id) = self.active_rule_id {
|
||||
if let Some(rule_editor) = self.rule_editors.get(&rule_id) {
|
||||
window.focus(&rule_editor.body_editor.focus_handle(cx));
|
||||
}
|
||||
if let Some(rule_id) = self.active_rule_id
|
||||
&& let Some(rule_editor) = self.rule_editors.get(&rule_id)
|
||||
{
|
||||
window.focus(&rule_editor.body_editor.focus_handle(cx));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -882,10 +880,10 @@ impl RulesLibrary {
|
|||
window: &mut Window,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
if let Some(rule_id) = self.active_rule_id {
|
||||
if let Some(rule_editor) = self.rule_editors.get(&rule_id) {
|
||||
window.focus(&rule_editor.title_editor.focus_handle(cx));
|
||||
}
|
||||
if let Some(rule_id) = self.active_rule_id
|
||||
&& let Some(rule_editor) = self.rule_editors.get(&rule_id)
|
||||
{
|
||||
window.focus(&rule_editor.title_editor.focus_handle(cx));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue