mirror of
https://github.com/ratatui/ratatui.git
synced 2025-09-28 13:31:14 +00:00
fix: rust 1.83 clippy lints (#1527)
https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
This commit is contained in:
parent
fbf6050c86
commit
2892bddce6
@ -250,7 +250,7 @@ pub trait Stylize<'a, T>: Sized {
|
||||
modifier!(crossed_out);
|
||||
}
|
||||
|
||||
impl<'a, T, U> Stylize<'a, T> for U
|
||||
impl<T, U> Stylize<'_, T> for U
|
||||
where
|
||||
U: Styled<Item = T>,
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ impl<'a> StyledGrapheme<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for StyledGrapheme<'a> {
|
||||
impl Styled for StyledGrapheme<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
|
@ -599,7 +599,7 @@ impl<'a> IntoIterator for &'a mut Line<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<String> for Line<'a> {
|
||||
impl From<String> for Line<'_> {
|
||||
fn from(s: String) -> Self {
|
||||
Self::raw(s)
|
||||
}
|
||||
@ -830,7 +830,7 @@ impl fmt::Display for Line<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for Line<'a> {
|
||||
impl Styled for Line<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
|
@ -404,7 +404,7 @@ impl<'a> std::ops::Add<Self> for Span<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for Span<'a> {
|
||||
impl Styled for Span<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
|
@ -598,7 +598,7 @@ impl<'a> IntoIterator for &'a mut Text<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<String> for Text<'a> {
|
||||
impl From<String> for Text<'_> {
|
||||
fn from(s: String) -> Self {
|
||||
Self::raw(s)
|
||||
}
|
||||
@ -668,7 +668,7 @@ impl<'a> std::ops::Add<Line<'a>> for Text<'a> {
|
||||
/// Adds two `Text` together.
|
||||
///
|
||||
/// This ignores the style and alignment of the second `Text`.
|
||||
impl<'a> std::ops::Add<Self> for Text<'a> {
|
||||
impl std::ops::Add<Self> for Text<'_> {
|
||||
type Output = Self;
|
||||
|
||||
fn add(mut self, text: Self) -> Self::Output {
|
||||
@ -744,7 +744,7 @@ impl Widget for &Text<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for Text<'a> {
|
||||
impl Styled for Text<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
|
@ -108,7 +108,7 @@ pub struct BarChart<'a> {
|
||||
direction: Direction,
|
||||
}
|
||||
|
||||
impl<'a> Default for BarChart<'a> {
|
||||
impl Default for BarChart<'_> {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
block: None,
|
||||
@ -682,7 +682,7 @@ impl Widget for &BarChart<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for BarChart<'a> {
|
||||
impl Styled for BarChart<'_> {
|
||||
type Item = Self;
|
||||
fn style(&self) -> Style {
|
||||
self.style
|
||||
|
@ -285,7 +285,7 @@ impl<'a> Bar<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for Bar<'a> {
|
||||
impl Styled for Bar<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
|
@ -895,7 +895,7 @@ impl BlockExt for Option<Block<'_>> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for Block<'a> {
|
||||
impl Styled for Block<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
|
@ -348,7 +348,7 @@ pub struct Painter<'a, 'b> {
|
||||
resolution: (f64, f64),
|
||||
}
|
||||
|
||||
impl<'a, 'b> Painter<'a, 'b> {
|
||||
impl Painter<'_, '_> {
|
||||
/// Convert the `(x, y)` coordinates to location of a point on the grid
|
||||
///
|
||||
/// `(x, y)` coordinates are expressed in the coordinate system of the canvas. The origin is in
|
||||
@ -646,7 +646,7 @@ where
|
||||
marker: Marker,
|
||||
}
|
||||
|
||||
impl<'a, F> Default for Canvas<'a, F>
|
||||
impl<F> Default for Canvas<'_, F>
|
||||
where
|
||||
F: Fn(&mut Context),
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ pub struct Points<'a> {
|
||||
pub color: Color,
|
||||
}
|
||||
|
||||
impl<'a> Shape for Points<'a> {
|
||||
impl Shape for Points<'_> {
|
||||
fn draw(&self, painter: &mut Painter) {
|
||||
for (x, y) in self.coords {
|
||||
if let Some((x, y)) = painter.get_point(*x, *y) {
|
||||
|
@ -1120,7 +1120,7 @@ impl Widget for &Chart<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for Axis<'a> {
|
||||
impl Styled for Axis<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
@ -1132,7 +1132,7 @@ impl<'a> Styled for Axis<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for Dataset<'a> {
|
||||
impl Styled for Dataset<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
@ -1144,7 +1144,7 @@ impl<'a> Styled for Dataset<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for Chart<'a> {
|
||||
impl Styled for Chart<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
|
@ -423,7 +423,7 @@ impl Widget for &LineGauge<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for Gauge<'a> {
|
||||
impl Styled for Gauge<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
@ -435,7 +435,7 @@ impl<'a> Styled for Gauge<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for LineGauge<'a> {
|
||||
impl Styled for LineGauge<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
|
@ -430,7 +430,7 @@ impl<'a> List<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for List<'a> {
|
||||
impl Styled for List<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
@ -442,7 +442,7 @@ impl<'a> Styled for List<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for ListItem<'a> {
|
||||
impl Styled for ListItem<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
|
@ -489,7 +489,7 @@ impl<'a> Paragraph<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for Paragraph<'a> {
|
||||
impl Styled for Paragraph<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
|
@ -172,7 +172,7 @@ pub enum ScrollDirection {
|
||||
Backward,
|
||||
}
|
||||
|
||||
impl<'a> Default for Scrollbar<'a> {
|
||||
impl Default for Scrollbar<'_> {
|
||||
fn default() -> Self {
|
||||
Self::new(ScrollbarOrientation::default())
|
||||
}
|
||||
@ -496,7 +496,7 @@ impl ScrollbarState {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> StatefulWidget for Scrollbar<'a> {
|
||||
impl StatefulWidget for Scrollbar<'_> {
|
||||
type State = ScrollbarState;
|
||||
|
||||
fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {
|
||||
|
@ -312,7 +312,7 @@ impl From<&Option<u64>> for SparklineBar {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for Sparkline<'a> {
|
||||
impl Styled for Sparkline<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
|
@ -279,7 +279,7 @@ pub struct Table<'a> {
|
||||
flex: Flex,
|
||||
}
|
||||
|
||||
impl<'a> Default for Table<'a> {
|
||||
impl Default for Table<'_> {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
rows: Vec::new(),
|
||||
@ -1044,7 +1044,7 @@ fn ensure_percentages_less_than_100(widths: &[Constraint]) {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for Table<'a> {
|
||||
impl Styled for Table<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
|
@ -179,7 +179,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for Cell<'a> {
|
||||
impl Styled for Cell<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
|
@ -251,7 +251,7 @@ impl Row<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for Row<'a> {
|
||||
impl Styled for Row<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
|
@ -350,7 +350,7 @@ impl<'a> Tabs<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Styled for Tabs<'a> {
|
||||
impl Styled for Tabs<'_> {
|
||||
type Item = Self;
|
||||
|
||||
fn style(&self) -> Style {
|
||||
|
@ -109,7 +109,7 @@ impl<'a> Button<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Widget for Button<'a> {
|
||||
impl Widget for Button<'_> {
|
||||
#[allow(clippy::cast_possible_truncation)]
|
||||
fn render(self, area: Rect, buf: &mut Buffer) {
|
||||
let (background, text, shadow, highlight) = self.colors();
|
||||
|
@ -25,7 +25,7 @@ impl Ingredient {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<Ingredient> for Row<'a> {
|
||||
impl From<Ingredient> for Row<'_> {
|
||||
fn from(i: Ingredient) -> Self {
|
||||
Row::new(vec![i.quantity, i.name]).height(i.height())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user