From cf5351b770681d64b392761c32ad29303ad51607 Mon Sep 17 00:00:00 2001 From: gwenn Date: Fri, 11 Oct 2024 18:52:26 +0200 Subject: [PATCH] Fix clippy needless_lifetimes warnings --- src/edit.rs | 8 ++++---- src/keymap.rs | 2 +- src/lib.rs | 2 +- src/tty/test.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/edit.rs b/src/edit.rs index af75622ec..b18de9e2e 100644 --- a/src/edit.rs +++ b/src/edit.rs @@ -253,13 +253,13 @@ impl<'out, 'prompt, H: Helper> State<'out, 'prompt, H> { } } -impl<'out, 'prompt, H: Helper> Invoke for State<'out, 'prompt, H> { +impl Invoke for State<'_, '_, H> { fn input(&self) -> &str { self.line.as_str() } } -impl<'out, 'prompt, H: Helper> Refresher for State<'out, 'prompt, H> { +impl Refresher for State<'_, '_, H> { fn refresh_line(&mut self) -> Result<()> { let prompt_size = self.prompt_size; self.hint(); @@ -325,7 +325,7 @@ impl<'out, 'prompt, H: Helper> Refresher for State<'out, 'prompt, H> { } } -impl<'out, 'prompt, H: Helper> fmt::Debug for State<'out, 'prompt, H> { +impl fmt::Debug for State<'_, '_, H> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("State") .field("prompt", &self.prompt) @@ -338,7 +338,7 @@ impl<'out, 'prompt, H: Helper> fmt::Debug for State<'out, 'prompt, H> { } } -impl<'out, 'prompt, H: Helper> State<'out, 'prompt, H> { +impl State<'_, '_, H> { pub fn clear_screen(&mut self) -> Result<()> { self.out.clear_screen()?; self.layout.cursor = Position::default(); diff --git a/src/keymap.rs b/src/keymap.rs index 9bef72798..c8561207c 100644 --- a/src/keymap.rs +++ b/src/keymap.rs @@ -1125,7 +1125,7 @@ impl<'b> InputState<'b> { } #[cfg(feature = "custom-bindings")] -impl<'b> InputState<'b> { +impl InputState<'_> { /// Application customized binding fn custom_binding( &self, diff --git a/src/lib.rs b/src/lib.rs index c48757e42..701565037 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -967,7 +967,7 @@ struct Iter<'a, H: Helper, I: History> { prompt: &'a str, } -impl<'a, H: Helper, I: History> Iterator for Iter<'a, H, I> { +impl Iterator for Iter<'_, H, I> { type Item = Result; fn next(&mut self) -> Option> { diff --git a/src/tty/test.rs b/src/tty/test.rs index 00ef42152..3478baf9f 100644 --- a/src/tty/test.rs +++ b/src/tty/test.rs @@ -21,7 +21,7 @@ impl RawMode for Mode { } } -impl<'a> RawReader for Iter<'a, KeyEvent> { +impl RawReader for Iter<'_, KeyEvent> { type Buffer = Buffer; fn wait_for_input(&mut self, single_esc_abort: bool) -> Result {