Skip to content

Commit 4655aa2

Browse files
committed
clippy 1.83: apply explicit lifetimes elisions suggestions
1 parent 9594713 commit 4655aa2

File tree

15 files changed

+17
-17
lines changed

15 files changed

+17
-17
lines changed

src/ansi/iterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl<'a> AnsiElementIterator<'a> {
7979
}
8080
}
8181

82-
impl<'a> Iterator for AnsiElementIterator<'a> {
82+
impl Iterator for AnsiElementIterator<'_> {
8383
type Item = Element;
8484

8585
fn next(&mut self) -> Option<Element> {

src/format.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub type FormatStringPlaceholderData<'a> =
9494

9595
pub type FormatStringSimple = FormatStringPlaceholderDataAnyPlaceholder<()>;
9696

97-
impl<'a> FormatStringPlaceholderData<'a> {
97+
impl FormatStringPlaceholderData<'_> {
9898
pub fn width(&self, hunk_max_line_number_width: usize) -> (usize, usize) {
9999
// Only if Some(placeholder) is present will there be a number formatted
100100
// by this placeholder, if not width is also None.
@@ -246,7 +246,7 @@ impl CenterRightNumbers for String {
246246
}
247247
}
248248

249-
impl<'a> CenterRightNumbers for &std::borrow::Cow<'a, str> {
249+
impl CenterRightNumbers for &std::borrow::Cow<'_, str> {
250250
fn center_right_space(&self, alignment: Align, width: usize) -> &'static str {
251251
self.as_ref().center_right_space(alignment, width)
252252
}

src/handlers/blame.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub enum BlameLineNumbers {
2424
Every(usize, FormatStringSimple),
2525
}
2626

27-
impl<'a> StateMachine<'a> {
27+
impl StateMachine<'_> {
2828
/// If this is a line of git blame output then render it accordingly. If
2929
/// this is the first blame line, then set the syntax-highlighter language
3030
/// according to delta.default-language.

src/handlers/commit_meta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use super::draw;
44
use crate::delta::{State, StateMachine};
55
use crate::features;
66

7-
impl<'a> StateMachine<'a> {
7+
impl StateMachine<'_> {
88
#[inline]
99
fn test_commit_meta_header_line(&self) -> bool {
1010
self.config.commit_regex.is_match(&self.line)

src/handlers/diff_header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub enum FileEvent {
2222
NoEvent,
2323
}
2424

25-
impl<'a> StateMachine<'a> {
25+
impl StateMachine<'_> {
2626
/// Check for the old mode|new mode lines and cache their info for later use.
2727
pub fn handle_diff_header_mode_line(&mut self) -> std::io::Result<bool> {
2828
let mut handled_line = false;

src/handlers/diff_header_diff.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::delta::{DiffType, InMergeConflict, MergeParents, State, StateMachine};
22
use crate::handlers::diff_header::{get_repeated_file_path_from_diff_line, FileEvent};
33

4-
impl<'a> StateMachine<'a> {
4+
impl StateMachine<'_> {
55
#[inline]
66
fn test_diff_header_diff_line(&self) -> bool {
77
self.line.starts_with("diff ")

src/handlers/diff_header_misc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::delta::{DiffType, Source, State, StateMachine};
22
use crate::utils::path::relativize_path_maybe;
33

4-
impl<'a> StateMachine<'a> {
4+
impl StateMachine<'_> {
55
#[inline]
66
fn test_diff_file_missing(&self) -> bool {
77
self.source == Source::DiffUnified && self.line.starts_with("Only in ")

src/handlers/diff_stat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::delta::{State, StateMachine};
77
use crate::features;
88
use crate::utils;
99

10-
impl<'a> StateMachine<'a> {
10+
impl StateMachine<'_> {
1111
#[inline]
1212
fn test_diff_stat_line(&self) -> bool {
1313
(self.state == State::CommitMeta || self.state == State::Unknown)

src/handlers/git_show_file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::delta::{State, StateMachine};
22
use crate::paint::{BgShouldFill, StyleSectionSpecifier};
33
use crate::utils::process;
44

5-
impl<'a> StateMachine<'a> {
5+
impl StateMachine<'_> {
66
// If this is a line of `git show $revision:/path/to/file.ext` output then
77
// syntax-highlight it as language `ext`.
88
pub fn handle_git_show_file_line(&mut self) -> std::io::Result<bool> {

src/handlers/grep.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub struct GrepLine<'b> {
2727
pub submatches: Option<Vec<(usize, usize)>>,
2828
}
2929

30-
impl<'b> GrepLine<'b> {
30+
impl GrepLine<'_> {
3131
fn expand_tabs(&mut self, tab_cfg: &tabs::TabCfg) {
3232
let old_len = self.code.len();
3333
self.code = tabs::expand(&self.code, tab_cfg).into();
@@ -79,7 +79,7 @@ impl LineType {
7979
}
8080
}
8181

82-
impl<'a> StateMachine<'a> {
82+
impl StateMachine<'_> {
8383
// If this is a line of grep output then render it accordingly.
8484
pub fn handle_grep_line(&mut self) -> std::io::Result<bool> {
8585
self.painter.emit()?;

0 commit comments

Comments
 (0)