From 06fba016c10cafc640238832304f3cf251f449e0 Mon Sep 17 00:00:00 2001 From: rhysd Date: Fri, 10 Feb 2023 10:48:31 +0900 Subject: [PATCH] chore: fix all clippy warnings --- examples/panic.rs | 2 +- src/buffer.rs | 4 ++-- src/widgets/list.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/panic.rs b/examples/panic.rs index 057ee4d..4cdbaaa 100644 --- a/examples/panic.rs +++ b/examples/panic.rs @@ -59,7 +59,7 @@ fn main() -> Result<()> { reset_terminal()?; if let Err(err) = res { - println!("{:?}", err); + println!("{err:?}"); } Ok(()) diff --git a/src/buffer.rs b/src/buffer.rs index c9cbb04..e813031 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -306,7 +306,7 @@ impl Buffer { (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 x = x; for span in &spans.0 { @@ -327,7 +327,7 @@ impl Buffer { (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) } diff --git a/src/widgets/list.rs b/src/widgets/list.rs index d785d54..29d64aa 100644 --- a/src/widgets/list.rs +++ b/src/widgets/list.rs @@ -243,11 +243,11 @@ impl<'a> StatefulWidget for List<'a> { list_area.width as usize, item_style, ); - (elem_x, (list_area.width - (elem_x - x)) as u16) + (elem_x, (list_area.width - (elem_x - x))) } else { (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 { buf.set_style(area, self.highlight_style);