Skip to content

Commit

Permalink
fix: clippy lints from rust 1.80.0 (#1238)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshka authored Jul 26, 2024
1 parent 03f3124 commit 84f3341
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`].
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/list/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/widgets/table/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -927,13 +927,18 @@ 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)]);

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)]);

Expand Down

0 comments on commit 84f3341

Please sign in to comment.