Skip to content

Commit 809547e

Browse files
committed
Fix all mismatched_lifetime_syntaxes warnings
Since Rust 1.89.0, a warning is emitted by default when the lifetime of the return type is implicitly elided but matches an input parameter of the function. rustc tells us how to fix it (but weirdly enough there is no cargo fix for it), so let’s do that, it makes the elided lifetime much more evident anyway.
1 parent f5893d9 commit 809547e

File tree

19 files changed

+25
-25
lines changed

19 files changed

+25
-25
lines changed

asyncgit/src/sync/remotes/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ pub fn get_default_remote(repo_path: &RepoPath) -> Result<String> {
120120
/// and Err if there was a problem finding the branch
121121
fn get_current_branch(
122122
repo: &Repository,
123-
) -> Result<Option<git2::Branch>> {
123+
) -> Result<Option<git2::Branch<'_>>> {
124124
for b in repo.branches(None)? {
125125
let branch = b?.0;
126126
if branch.is_head() {

asyncgit/src/sync/reword.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub fn reword(
6262
/// and Err if there was a problem finding the branch
6363
fn get_current_branch(
6464
repo: &Repository,
65-
) -> Result<Option<git2::Branch>> {
65+
) -> Result<Option<git2::Branch<'_>>> {
6666
for b in repo.branches(None)? {
6767
let branch = b?.0;
6868
if branch.is_head() {

src/components/commit_details/compare_details.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl CompareDetailsComponent {
5858
});
5959
}
6060

61-
fn get_commit_text(&self, data: &CommitDetails) -> Vec<Line> {
61+
fn get_commit_text(&self, data: &CommitDetails) -> Vec<Line<'_>> {
6262
let mut res = vec![
6363
Line::from(vec![
6464
style_detail(&self.theme, &Detail::Author),

src/components/commit_details/details.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl DetailsComponent {
136136
&self,
137137
width: usize,
138138
height: usize,
139-
) -> Vec<Line> {
139+
) -> Vec<Line<'_>> {
140140
let (wrapped_title, wrapped_message) =
141141
Self::get_wrapped_lines(self.data.as_ref(), width);
142142

@@ -156,7 +156,7 @@ impl DetailsComponent {
156156
}
157157

158158
#[allow(clippy::too_many_lines)]
159-
fn get_text_info(&self) -> Vec<Line> {
159+
fn get_text_info(&self) -> Vec<Line<'_>> {
160160
self.data.as_ref().map_or_else(Vec::new, |data| {
161161
let mut res = vec![
162162
Line::from(vec![

src/components/commitlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ impl CommitList {
565565
Line::from(txt)
566566
}
567567

568-
fn get_text(&self, height: usize, width: usize) -> Vec<Line> {
568+
fn get_text(&self, height: usize, width: usize) -> Vec<Line<'_>> {
569569
let selection = self.relative_selection();
570570

571571
let mut txt: Vec<Line> = Vec::with_capacity(height);

src/components/diff.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ impl DiffComponent {
324324
None
325325
}
326326

327-
fn get_text(&self, width: u16, height: u16) -> Vec<Line> {
327+
fn get_text(&self, width: u16, height: u16) -> Vec<Line<'_>> {
328328
if let Some(diff) = &self.diff {
329329
return if diff.hunks.is_empty() {
330330
self.get_text_binary(diff)
@@ -387,7 +387,7 @@ impl DiffComponent {
387387
vec![]
388388
}
389389

390-
fn get_text_binary(&self, diff: &FileDiff) -> Vec<Line> {
390+
fn get_text_binary(&self, diff: &FileDiff) -> Vec<Line<'_>> {
391391
let is_positive = diff.size_delta >= 0;
392392
let delta_byte_size =
393393
ByteSize::b(diff.size_delta.unsigned_abs());

src/components/status_tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ impl StatusTreeComponent {
223223
/// allowing folders to be folded up if they are alone in their directory
224224
fn build_vec_text_draw_info_for_drawing(
225225
&self,
226-
) -> (Vec<TextDrawInfo>, usize, usize) {
226+
) -> (Vec<TextDrawInfo<'_>>, usize, usize) {
227227
let mut should_skip_over: usize = 0;
228228
let mut selection_offset: usize = 0;
229229
let mut selection_offset_visible: usize = 0;

src/popups/blame_file.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ impl BlameFilePopup {
529529
}
530530

531531
///
532-
fn get_rows(&self, width: usize) -> Vec<Row> {
532+
fn get_rows(&self, width: usize) -> Vec<Row<'_>> {
533533
self.blame
534534
.as_ref()
535535
.and_then(|blame| blame.result())
@@ -643,7 +643,7 @@ impl BlameFilePopup {
643643
&self,
644644
width: usize,
645645
blame_hunk: Option<&BlameHunk>,
646-
) -> Vec<Cell> {
646+
) -> Vec<Cell<'_>> {
647647
let commit_hash = blame_hunk.map_or_else(
648648
|| NO_COMMIT_ID.into(),
649649
|hunk| hunk.commit_id.get_short_string(),

src/popups/branchlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ impl BranchListPopup {
473473
theme: &SharedTheme,
474474
width_available: u16,
475475
height: usize,
476-
) -> Text {
476+
) -> Text<'_> {
477477
const UPSTREAM_SYMBOL: char = '\u{2191}';
478478
const TRACKING_SYMBOL: char = '\u{2193}';
479479
const HEAD_SYMBOL: char = '*';

src/popups/file_revlog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ impl FileRevlogPopup {
263263
)
264264
}
265265

266-
fn get_rows(&self, now: DateTime<Local>) -> Vec<Row> {
266+
fn get_rows(&self, now: DateTime<Local>) -> Vec<Row<'_>> {
267267
self.items
268268
.iter()
269269
.map(|entry| {

0 commit comments

Comments
 (0)