clippy: explicit lifetimes

With Rust 1.89.0, there was introduction to the mismatched lifetime
syntax lint[^1].

The suggestion is to use implicit lifetimes via `<'_>`, however, to
maintain the MSRV, the lifetimes are made explicit here by introducing
an (or using the existing) `'a` lifetime.

[^1]: https://blog.rust-lang.org/2025/08/07/Rust-1.89.0/#mismatched-lifetime-syntaxes-lint
This commit is contained in:
Fintan Halpenny
2025-12-08 15:11:21 +00:00
parent 320f316674
commit 68d6fa879f
10 changed files with 52 additions and 37 deletions
+1 -1
View File
@@ -125,7 +125,7 @@ impl<Tree, Parent> CommitData<Tree, Parent> {
/// The [`Signature`]s found in this commit, i.e. the headers corresponding
/// to `gpgsig`.
pub fn signatures(&self) -> impl Iterator<Item = Signature> + '_ {
pub fn signatures<'a>(&'a self) -> impl Iterator<Item = Signature<'a>> + 'a {
self.headers.signatures()
}
+1 -1
View File
@@ -56,7 +56,7 @@ impl Headers {
.filter_map(move |(k, v)| (k == name).then_some(v))
}
pub fn signatures(&self) -> impl Iterator<Item = Signature> + '_ {
pub fn signatures<'a>(&'a self) -> impl Iterator<Item = Signature<'a>> + 'a {
self.0.iter().filter_map(|(k, v)| {
if k == "gpgsig" {
Signature::from_str(v).ok()
+1 -1
View File
@@ -106,7 +106,7 @@ pub enum Node<'a> {
Tree(Tree<'a>),
}
pub fn blob(slice: &[u8]) -> Node {
pub fn blob<'a>(slice: &'a [u8]) -> Node<'a> {
Node::from(slice)
}