fix(clippy): 修复冗余 into_iter、sort_by 及 match 嵌套 if 等 lint 警告

This commit is contained in:
fawney19
2026-04-17 01:43:45 +08:00
parent dde02e6111
commit faaaec28e1
12 changed files with 115 additions and 134 deletions

View File

@@ -514,9 +514,7 @@ impl App {
KeyCode::Up | KeyCode::Char('k') => {
self.selected = self.selected.saturating_sub(1);
}
KeyCode::Down | KeyCode::Char('j')
if self.selected + 1 < self.total_field_count() =>
{
KeyCode::Down | KeyCode::Char('j') if self.selected + 1 < self.total_field_count() => {
self.selected += 1;
}
KeyCode::Home => self.selected = 0,
@@ -624,11 +622,9 @@ impl App {
let byte = self.char_byte_pos(self.edit_cursor);
self.edit_buffer.remove(byte);
}
KeyCode::Delete => {
if self.edit_cursor < self.edit_buffer.chars().count() {
let byte = self.char_byte_pos(self.edit_cursor);
self.edit_buffer.remove(byte);
}
KeyCode::Delete if self.edit_cursor < self.edit_buffer.chars().count() => {
let byte = self.char_byte_pos(self.edit_cursor);
self.edit_buffer.remove(byte);
}
KeyCode::Left => {
self.edit_cursor = self.edit_cursor.saturating_sub(1);