chore: fix all clippy warnings

pull/689/head
rhysd 1 year ago
parent 26f280db93
commit 06fba016c1

@ -59,7 +59,7 @@ fn main() -> Result<()> {
reset_terminal()?; reset_terminal()?;
if let Err(err) = res { if let Err(err) = res {
println!("{:?}", err); println!("{err:?}");
} }
Ok(()) Ok(())

@ -306,7 +306,7 @@ impl Buffer {
(x_offset as u16, y) (x_offset as u16, y)
} }
pub fn set_spans<'a>(&mut self, x: u16, y: u16, spans: &Spans<'a>, width: u16) -> (u16, u16) { pub fn set_spans(&mut self, x: u16, y: u16, spans: &Spans<'_>, width: u16) -> (u16, u16) {
let mut remaining_width = width; let mut remaining_width = width;
let mut x = x; let mut x = x;
for span in &spans.0 { for span in &spans.0 {
@ -327,7 +327,7 @@ impl Buffer {
(x, y) (x, y)
} }
pub fn set_span<'a>(&mut self, x: u16, y: u16, span: &Span<'a>, width: u16) -> (u16, u16) { pub fn set_span(&mut self, x: u16, y: u16, span: &Span<'_>, width: u16) -> (u16, u16) {
self.set_stringn(x, y, span.content.as_ref(), width as usize, span.style) self.set_stringn(x, y, span.content.as_ref(), width as usize, span.style)
} }

@ -243,11 +243,11 @@ impl<'a> StatefulWidget for List<'a> {
list_area.width as usize, list_area.width as usize,
item_style, item_style,
); );
(elem_x, (list_area.width - (elem_x - x)) as u16) (elem_x, (list_area.width - (elem_x - x)))
} else { } else {
(x, list_area.width) (x, list_area.width)
}; };
buf.set_spans(elem_x, y + j as u16, line, max_element_width as u16); buf.set_spans(elem_x, y + j as u16, line, max_element_width);
} }
if is_selected { if is_selected {
buf.set_style(area, self.highlight_style); buf.set_style(area, self.highlight_style);

Loading…
Cancel
Save