mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-10 07:04:17 +00:00
fix: clippy lints from rust 1.80.0 (#1238)
This commit is contained in:
parent
03f3124c1d
commit
84f334163b
4 changed files with 8 additions and 3 deletions
|
@ -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`].
|
||||
|
|
|
@ -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::{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)]);
|
||||
|
||||
|
|
Loading…
Reference in a new issue