fix: rust 1.83 clippy lints (#1527)

https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
This commit is contained in:
Josh McKinney 2024-11-28 23:49:12 -08:00 committed by GitHub
parent fbf6050c86
commit 2892bddce6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 33 additions and 33 deletions

View File

@ -250,7 +250,7 @@ pub trait Stylize<'a, T>: Sized {
modifier!(crossed_out); modifier!(crossed_out);
} }
impl<'a, T, U> Stylize<'a, T> for U impl<T, U> Stylize<'_, T> for U
where where
U: Styled<Item = T>, U: Styled<Item = T>,
{ {

View File

@ -34,7 +34,7 @@ impl<'a> StyledGrapheme<'a> {
} }
} }
impl<'a> Styled for StyledGrapheme<'a> { impl Styled for StyledGrapheme<'_> {
type Item = Self; type Item = Self;
fn style(&self) -> Style { fn style(&self) -> Style {

View File

@ -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 { fn from(s: String) -> Self {
Self::raw(s) 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; type Item = Self;
fn style(&self) -> Style { fn style(&self) -> Style {

View File

@ -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; type Item = Self;
fn style(&self) -> Style { fn style(&self) -> Style {

View File

@ -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 { fn from(s: String) -> Self {
Self::raw(s) Self::raw(s)
} }
@ -668,7 +668,7 @@ impl<'a> std::ops::Add<Line<'a>> for Text<'a> {
/// Adds two `Text` together. /// Adds two `Text` together.
/// ///
/// This ignores the style and alignment of the second `Text`. /// 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; type Output = Self;
fn add(mut self, text: Self) -> Self::Output { 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; type Item = Self;
fn style(&self) -> Style { fn style(&self) -> Style {

View File

@ -108,7 +108,7 @@ pub struct BarChart<'a> {
direction: Direction, direction: Direction,
} }
impl<'a> Default for BarChart<'a> { impl Default for BarChart<'_> {
fn default() -> Self { fn default() -> Self {
Self { Self {
block: None, block: None,
@ -682,7 +682,7 @@ impl Widget for &BarChart<'_> {
} }
} }
impl<'a> Styled for BarChart<'a> { impl Styled for BarChart<'_> {
type Item = Self; type Item = Self;
fn style(&self) -> Style { fn style(&self) -> Style {
self.style self.style

View File

@ -285,7 +285,7 @@ impl<'a> Bar<'a> {
} }
} }
impl<'a> Styled for Bar<'a> { impl Styled for Bar<'_> {
type Item = Self; type Item = Self;
fn style(&self) -> Style { fn style(&self) -> Style {

View File

@ -895,7 +895,7 @@ impl BlockExt for Option<Block<'_>> {
} }
} }
impl<'a> Styled for Block<'a> { impl Styled for Block<'_> {
type Item = Self; type Item = Self;
fn style(&self) -> Style { fn style(&self) -> Style {

View File

@ -348,7 +348,7 @@ pub struct Painter<'a, 'b> {
resolution: (f64, f64), resolution: (f64, f64),
} }
impl<'a, 'b> Painter<'a, 'b> { impl Painter<'_, '_> {
/// Convert the `(x, y)` coordinates to location of a point on the grid /// 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 /// `(x, y)` coordinates are expressed in the coordinate system of the canvas. The origin is in
@ -646,7 +646,7 @@ where
marker: Marker, marker: Marker,
} }
impl<'a, F> Default for Canvas<'a, F> impl<F> Default for Canvas<'_, F>
where where
F: Fn(&mut Context), F: Fn(&mut Context),
{ {

View File

@ -11,7 +11,7 @@ pub struct Points<'a> {
pub color: Color, pub color: Color,
} }
impl<'a> Shape for Points<'a> { impl Shape for Points<'_> {
fn draw(&self, painter: &mut Painter) { fn draw(&self, painter: &mut Painter) {
for (x, y) in self.coords { for (x, y) in self.coords {
if let Some((x, y)) = painter.get_point(*x, *y) { if let Some((x, y)) = painter.get_point(*x, *y) {

View File

@ -1120,7 +1120,7 @@ impl Widget for &Chart<'_> {
} }
} }
impl<'a> Styled for Axis<'a> { impl Styled for Axis<'_> {
type Item = Self; type Item = Self;
fn style(&self) -> Style { 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; type Item = Self;
fn style(&self) -> Style { 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; type Item = Self;
fn style(&self) -> Style { fn style(&self) -> Style {

View File

@ -423,7 +423,7 @@ impl Widget for &LineGauge<'_> {
} }
} }
impl<'a> Styled for Gauge<'a> { impl Styled for Gauge<'_> {
type Item = Self; type Item = Self;
fn style(&self) -> Style { 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; type Item = Self;
fn style(&self) -> Style { fn style(&self) -> Style {

View File

@ -430,7 +430,7 @@ impl<'a> List<'a> {
} }
} }
impl<'a> Styled for List<'a> { impl Styled for List<'_> {
type Item = Self; type Item = Self;
fn style(&self) -> Style { 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; type Item = Self;
fn style(&self) -> Style { fn style(&self) -> Style {

View File

@ -489,7 +489,7 @@ impl<'a> Paragraph<'a> {
} }
} }
impl<'a> Styled for Paragraph<'a> { impl Styled for Paragraph<'_> {
type Item = Self; type Item = Self;
fn style(&self) -> Style { fn style(&self) -> Style {

View File

@ -172,7 +172,7 @@ pub enum ScrollDirection {
Backward, Backward,
} }
impl<'a> Default for Scrollbar<'a> { impl Default for Scrollbar<'_> {
fn default() -> Self { fn default() -> Self {
Self::new(ScrollbarOrientation::default()) Self::new(ScrollbarOrientation::default())
} }
@ -496,7 +496,7 @@ impl ScrollbarState {
} }
} }
impl<'a> StatefulWidget for Scrollbar<'a> { impl StatefulWidget for Scrollbar<'_> {
type State = ScrollbarState; type State = ScrollbarState;
fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State) { fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {

View File

@ -312,7 +312,7 @@ impl From<&Option<u64>> for SparklineBar {
} }
} }
impl<'a> Styled for Sparkline<'a> { impl Styled for Sparkline<'_> {
type Item = Self; type Item = Self;
fn style(&self) -> Style { fn style(&self) -> Style {

View File

@ -279,7 +279,7 @@ pub struct Table<'a> {
flex: Flex, flex: Flex,
} }
impl<'a> Default for Table<'a> { impl Default for Table<'_> {
fn default() -> Self { fn default() -> Self {
Self { Self {
rows: Vec::new(), 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; type Item = Self;
fn style(&self) -> Style { fn style(&self) -> Style {

View File

@ -179,7 +179,7 @@ where
} }
} }
impl<'a> Styled for Cell<'a> { impl Styled for Cell<'_> {
type Item = Self; type Item = Self;
fn style(&self) -> Style { fn style(&self) -> Style {

View File

@ -251,7 +251,7 @@ impl Row<'_> {
} }
} }
impl<'a> Styled for Row<'a> { impl Styled for Row<'_> {
type Item = Self; type Item = Self;
fn style(&self) -> Style { fn style(&self) -> Style {

View File

@ -350,7 +350,7 @@ impl<'a> Tabs<'a> {
} }
} }
impl<'a> Styled for Tabs<'a> { impl Styled for Tabs<'_> {
type Item = Self; type Item = Self;
fn style(&self) -> Style { fn style(&self) -> Style {

View File

@ -109,7 +109,7 @@ impl<'a> Button<'a> {
} }
} }
impl<'a> Widget for Button<'a> { impl Widget for Button<'_> {
#[allow(clippy::cast_possible_truncation)] #[allow(clippy::cast_possible_truncation)]
fn render(self, area: Rect, buf: &mut Buffer) { fn render(self, area: Rect, buf: &mut Buffer) {
let (background, text, shadow, highlight) = self.colors(); let (background, text, shadow, highlight) = self.colors();

View File

@ -25,7 +25,7 @@ impl Ingredient {
} }
} }
impl<'a> From<Ingredient> for Row<'a> { impl From<Ingredient> for Row<'_> {
fn from(i: Ingredient) -> Self { fn from(i: Ingredient) -> Self {
Row::new(vec![i.quantity, i.name]).height(i.height()) Row::new(vec![i.quantity, i.name]).height(i.height())
} }