mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-11-21 18:40:40 +08:00
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:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user