From c43e9cf943ec488b9cc75b15a8359709176e3048 Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Fri, 26 Jul 2024 00:55:07 -0700 Subject: [PATCH] fix: clippy lints from rust 1.80.0 (#1238) --- src/text.rs | 2 +- src/widgets/block.rs | 2 +- src/widgets/list/list.rs | 2 +- src/widgets/table/table.rs | 5 +++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/text.rs b/src/text.rs index 8ae719a45f..92a43d249e 100644 --- a/src/text.rs +++ b/src/text.rs @@ -5,7 +5,7 @@ //! - A single line string where all graphemes have the same style is represented by a [`Span`]. //! - A single line string where each grapheme may have its own style is represented by [`Line`]. //! - A multiple line string where each grapheme may have its own style is represented by a -//! [`Text`]. +//! [`Text`]. //! //! These types form a hierarchy: [`Line`] is a collection of [`Span`] and each line of [`Text`] //! is a [`Line`]. diff --git a/src/widgets/block.rs b/src/widgets/block.rs index 6f6e0276a1..4990363ffa 100644 --- a/src/widgets/block.rs +++ b/src/widgets/block.rs @@ -264,7 +264,7 @@ impl<'a> Block<'a> { /// The following example demonstrates: /// - Default title alignment /// - Multiple titles (notice "Center" is centered according to the full with of the block, not - /// the leftover space) + /// the leftover space) /// - Two titles with the same alignment (notice the left titles are separated) /// ``` /// use ratatui::{ diff --git a/src/widgets/list/list.rs b/src/widgets/list/list.rs index 683fe18f49..c89febfac0 100644 --- a/src/widgets/list/list.rs +++ b/src/widgets/list/list.rs @@ -35,7 +35,7 @@ use crate::{ /// - [`List::highlight_style`] sets the style of the selected item. /// - [`List::highlight_symbol`] sets the symbol to be displayed in front of the selected item. /// - [`List::repeat_highlight_symbol`] sets whether to repeat the symbol and style over selected -/// multi-line items +/// multi-line items /// - [`List::direction`] sets the list direction /// /// # Examples diff --git a/src/widgets/table/table.rs b/src/widgets/table/table.rs index 6ba245357e..2c04678431 100644 --- a/src/widgets/table/table.rs +++ b/src/widgets/table/table.rs @@ -927,6 +927,8 @@ mod tests { let table = Table::default().widths([Constraint::Length(100)]); assert_eq!(table.widths, [Constraint::Length(100)]); + // ensure that code that uses &[] continues to work as there is a large amount of code that + // uses this pattern #[allow(clippy::needless_borrows_for_generic_args)] let table = Table::default().widths(&[Constraint::Length(100)]); assert_eq!(table.widths, [Constraint::Length(100)]); @@ -934,6 +936,9 @@ mod tests { let table = Table::default().widths(vec![Constraint::Length(100)]); assert_eq!(table.widths, [Constraint::Length(100)]); + // ensure that code that uses &some_vec continues to work as there is a large amount of code + // that uses this pattern + #[allow(clippy::needless_borrows_for_generic_args)] let table = Table::default().widths(&vec![Constraint::Length(100)]); assert_eq!(table.widths, [Constraint::Length(100)]);