Fix a bunch of other low-hanging style lints (#36498)
- **Fix a bunch of low hanging style lints like unnecessary-return** - **Fix single worktree violation** - **And the rest** Release Notes: - N/A
This commit is contained in:
parent
df9c2aefb1
commit
05fc0c432c
239 changed files with 854 additions and 1015 deletions
|
@ -116,19 +116,19 @@ impl KeystrokeInput {
|
|||
&& self
|
||||
.keystrokes
|
||||
.last()
|
||||
.map_or(false, |last| last.key.is_empty())
|
||||
.is_some_and(|last| last.key.is_empty())
|
||||
{
|
||||
return &self.keystrokes[..self.keystrokes.len() - 1];
|
||||
}
|
||||
return &self.keystrokes;
|
||||
&self.keystrokes
|
||||
}
|
||||
|
||||
fn dummy(modifiers: Modifiers) -> Keystroke {
|
||||
return Keystroke {
|
||||
Keystroke {
|
||||
modifiers,
|
||||
key: "".to_string(),
|
||||
key_char: None,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
fn keystrokes_changed(&self, cx: &mut Context<Self>) {
|
||||
|
@ -182,7 +182,7 @@ impl KeystrokeInput {
|
|||
fn end_close_keystrokes_capture(&mut self) -> Option<usize> {
|
||||
self.close_keystrokes.take();
|
||||
self.clear_close_keystrokes_timer.take();
|
||||
return self.close_keystrokes_start.take();
|
||||
self.close_keystrokes_start.take()
|
||||
}
|
||||
|
||||
fn handle_possible_close_keystroke(
|
||||
|
@ -233,7 +233,7 @@ impl KeystrokeInput {
|
|||
return CloseKeystrokeResult::Partial;
|
||||
}
|
||||
self.end_close_keystrokes_capture();
|
||||
return CloseKeystrokeResult::None;
|
||||
CloseKeystrokeResult::None
|
||||
}
|
||||
|
||||
fn on_modifiers_changed(
|
||||
|
@ -437,7 +437,7 @@ impl KeystrokeInput {
|
|||
// is a much more reliable check, as the intercept keystroke handlers are installed
|
||||
// on focus of the inner focus handle, thereby ensuring our recording state does
|
||||
// not get de-synced
|
||||
return self.inner_focus_handle.is_focused(window);
|
||||
self.inner_focus_handle.is_focused(window)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -934,7 +934,7 @@ mod tests {
|
|||
let change_tracker = KeystrokeUpdateTracker::new(self.input.clone(), &mut self.cx);
|
||||
let result = self.input.update_in(&mut self.cx, cb);
|
||||
KeystrokeUpdateTracker::finish(change_tracker, &self.cx);
|
||||
return result;
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -731,7 +731,7 @@ impl<const COLS: usize> ColumnWidths<COLS> {
|
|||
}
|
||||
widths[col_idx] = widths[col_idx] + (diff - diff_remaining);
|
||||
|
||||
return diff_remaining;
|
||||
diff_remaining
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue