maint: fix clippy warnings

This commit is contained in:
2025-07-17 17:47:24 +03:00
parent b8e7430353
commit 3b1bdea1dd
84 changed files with 269 additions and 261 deletions
+11 -13
View File
@@ -83,14 +83,12 @@ impl Utf8Decoder {
let ch = str.chars().next().unwrap();
self.len = 0;
Some(ch)
} else if self.len == 4 {
// Got 4 bytes and could not decode a single character
self.len = 0;
Some('\u{25A1}')
} else {
if self.len == 4 {
// Got 4 bytes and could not decode a single character
self.len = 0;
Some('\u{25A1}')
} else {
None
}
None
}
}
}
@@ -284,7 +282,7 @@ impl State {
fn update_fg_color(&mut self) {
if let Some(fg_index) = self.fg_index {
self.attributes.fg = Color::from_escape(&*CONFIG, self.attributes.bold, fg_index)
self.attributes.fg = Color::from_escape(&CONFIG, self.attributes.bold, fg_index)
.unwrap_or(self.default_attributes.fg);
}
}
@@ -345,7 +343,7 @@ impl State {
}
_ => {
self.buffer
.set_cell(self.cursor, GridCell::new(ch as char, self.attributes));
.set_cell(self.cursor, GridCell::new(ch, self.attributes));
self.cursor.col += 1;
true
}
@@ -378,7 +376,7 @@ impl State {
fn handle_ctlseq(&mut self, byte: u8, c: char) -> bool {
let redraw = match c {
'h' if byte == b'?' => match self.esc_args.get(0).copied().unwrap_or(0) {
'h' if byte == b'?' => match self.esc_args.first().copied().unwrap_or(0) {
25 => {
// Cursor visible
self.cursor_visible = true;
@@ -391,7 +389,7 @@ impl State {
}
_ => false,
},
'l' if byte == b'?' => match self.esc_args.get(0).copied().unwrap_or(0) {
'l' if byte == b'?' => match self.esc_args.first().copied().unwrap_or(0) {
25 => {
// Cursor not visible
self.cursor_visible = false;
@@ -408,7 +406,7 @@ impl State {
_ => false,
},
'q' => {
match self.esc_args.get(0).copied().unwrap_or(0) {
match self.esc_args.first().copied().unwrap_or(0) {
3 | 4 => self.cursor_style = CursorStyle::Underline,
5 | 6 => self.cursor_style = CursorStyle::Bar,
_ => self.cursor_style = CursorStyle::Block,
@@ -500,7 +498,7 @@ impl State {
if vt_color == 9 {
self.attributes.bg = self.default_attributes.bg;
} else {
self.attributes.bg = Color::from_escape(&*CONFIG, false, vt_color)
self.attributes.bg = Color::from_escape(&CONFIG, false, vt_color)
.unwrap_or(self.default_attributes.bg);
}
false