Skip to content

Commit 6f337b1

Browse files
lf-facebook-github-bot
authored andcommitted
fix: a lot of instances of clippy::needless_lifetimes
Summary: This doesn't get all of them because: 1. there are so many of them 2. the lint is pretty jank Part of facebook/buck2#943 X-link: facebook/buck2#944 Reviewed By: JakobDegen Differential Revision: D74271655 Pulled By: dtolnay fbshipit-source-id: c7e41c47248d4be1f5d33a14b676ab35fc5180e2
1 parent e18d8a4 commit 6f337b1

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

examples/cargo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct LoadingBar<'a> {
2626
iteration: usize,
2727
}
2828

29-
impl<'a> Component for LoadingBar<'a> {
29+
impl Component for LoadingBar<'_> {
3030
fn draw_unchecked(
3131
&self,
3232

examples/finalization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct StoreName(String);
3232
#[derive(Display)]
3333
struct CustomerName(String);
3434

35-
impl<'a> Component for Greeter<'a> {
35+
impl Component for Greeter<'_> {
3636
fn draw_unchecked(&self, _dimensions: Dimensions, mode: DrawMode) -> anyhow::Result<Lines> {
3737
Ok(match mode {
3838
DrawMode::Normal => {

examples/stylized.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct StoreName(String);
3737
#[derive(Display)]
3838
struct CustomerName(String);
3939

40-
impl<'a> Component for Greeter<'a> {
40+
impl Component for Greeter<'_> {
4141
/// Prints a greeting to the current customer.
4242
fn draw_unchecked(&self, _dimensions: Dimensions, _mode: DrawMode) -> anyhow::Result<Lines> {
4343
let store_name = self.store_name;

src/components.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,19 @@ impl<C: Component> Component for Box<C> {
7777
}
7878
}
7979

80-
impl<'a> Component for &'a dyn Component {
80+
impl Component for &dyn Component {
8181
fn draw_unchecked(&self, dimensions: Dimensions, mode: DrawMode) -> anyhow::Result<Lines> {
8282
(**self).draw_unchecked(dimensions, mode)
8383
}
8484
}
8585

86-
impl<'a> Component for &'a (dyn Component + Send) {
86+
impl Component for &(dyn Component + Send) {
8787
fn draw_unchecked(&self, dimensions: Dimensions, mode: DrawMode) -> anyhow::Result<Lines> {
8888
(**self).draw_unchecked(dimensions, mode)
8989
}
9090
}
9191

92-
impl<'a, C: Component> Component for &'a C {
92+
impl<C: Component> Component for &C {
9393
fn draw_unchecked(&self, dimensions: Dimensions, mode: DrawMode) -> anyhow::Result<Lines> {
9494
(**self).draw_unchecked(dimensions, mode)
9595
}

src/content/line.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ impl Line {
210210

211211
pub fn fmt_for_test(&self) -> impl Display + '_ {
212212
struct Impl<'a>(&'a Line);
213-
impl<'a> Display for Impl<'a> {
213+
impl Display for Impl<'_> {
214214
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
215215
for span in &self.0.0 {
216216
write!(f, "{}", span.fmt_for_test())?;

src/content/lines.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ impl Lines {
364364

365365
pub fn fmt_for_test(&self) -> impl Display + '_ {
366366
struct Impl<'a>(&'a Lines);
367-
impl<'a> Display for Impl<'a> {
367+
impl Display for Impl<'_> {
368368
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
369369
for line in self.0.iter() {
370370
writeln!(f, "{}", line.fmt_for_test())?;

src/content/span.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ impl Span {
288288
}
289289

290290
struct Impl<'a>(&'a Span);
291-
impl<'a> Display for Impl<'a> {
291+
impl Display for Impl<'_> {
292292
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
293293
let style_is_default = self.0.style.foreground_color.is_none()
294294
&& self.0.style.background_color.is_none()
@@ -353,7 +353,7 @@ impl TryFrom<StyledContent<String>> for Span {
353353

354354
pub(crate) struct SpanIterator<'a>(&'a ContentStyle, Graphemes<'a>, &'a Option<Hyperlink>);
355355

356-
impl<'a> Iterator for SpanIterator<'a> {
356+
impl Iterator for SpanIterator<'_> {
357357
type Item = Span;
358358

359359
fn next(&mut self) -> Option<Self::Item> {

src/vec_as_fmt_write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::fmt;
1111

1212
pub(crate) struct VecAsFmtWrite<'a>(pub(crate) &'a mut Vec<u8>);
1313

14-
impl<'a> fmt::Write for VecAsFmtWrite<'a> {
14+
impl fmt::Write for VecAsFmtWrite<'_> {
1515
fn write_str(&mut self, s: &str) -> fmt::Result {
1616
self.0.extend_from_slice(s.as_bytes());
1717
Ok(())

0 commit comments

Comments
 (0)