Skip to content

Commit 143abd6

Browse files
authored
chore: fix rustc lint elided_named_lifetimes (#8796)
1 parent cb109b1 commit 143abd6

File tree

5 files changed

+14
-19
lines changed

5 files changed

+14
-19
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/common/src/ens.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! ENS Name resolving utilities.
22
3-
#![allow(missing_docs, elided_named_lifetimes)]
3+
#![allow(missing_docs)]
44

55
use self::EnsResolver::EnsResolverInstance;
66
use alloy_primitives::{address, Address, Keccak256, B256};

crates/config/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//!
33
//! Foundry configuration.
44
5-
#![allow(elided_named_lifetimes)]
65
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
76
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
87

@@ -1128,7 +1127,7 @@ impl Config {
11281127
pub fn get_rpc_url_or<'a>(
11291128
&'a self,
11301129
fallback: impl Into<Cow<'a, str>>,
1131-
) -> Result<Cow<'_, str>, UnresolvedEnvVarError> {
1130+
) -> Result<Cow<'a, str>, UnresolvedEnvVarError> {
11321131
if let Some(url) = self.get_rpc_url() {
11331132
url
11341133
} else {

crates/doc/src/preprocessor/infer_hyperlinks.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(elided_named_lifetimes)]
2-
31
use super::{Preprocessor, PreprocessorId};
42
use crate::{Comments, Document, ParseItem, ParseSource};
53
use forge_fmt::solang_ext::SafeUnwrap;
@@ -228,7 +226,7 @@ impl<'a> InlineLink<'a> {
228226
})
229227
}
230228

231-
fn captures(s: &'a str) -> impl Iterator<Item = Self> + '_ {
229+
fn captures(s: &'a str) -> impl Iterator<Item = Self> + 'a {
232230
RE_INLINE_LINK.captures(s).map(Self::from_capture).into_iter().flatten()
233231
}
234232

crates/forge/src/multi_runner.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! Forge test runner for multiple contracts.
22
3-
#![allow(elided_named_lifetimes)]
4-
53
use crate::{
64
progress::TestsProgress, result::SuiteResult, runner::LIBRARY_DEPLOYER, ContractRunner,
75
TestFilter, TestOptions,
@@ -86,28 +84,28 @@ pub struct MultiContractRunner {
8684

8785
impl MultiContractRunner {
8886
/// Returns an iterator over all contracts that match the filter.
89-
pub fn matching_contracts<'a>(
87+
pub fn matching_contracts<'a: 'b, 'b>(
9088
&'a self,
91-
filter: &'a dyn TestFilter,
92-
) -> impl Iterator<Item = (&ArtifactId, &TestContract)> {
89+
filter: &'b dyn TestFilter,
90+
) -> impl Iterator<Item = (&'a ArtifactId, &'a TestContract)> + 'b {
9391
self.contracts.iter().filter(|&(id, c)| matches_contract(id, &c.abi, filter))
9492
}
9593

9694
/// Returns an iterator over all test functions that match the filter.
97-
pub fn matching_test_functions<'a>(
95+
pub fn matching_test_functions<'a: 'b, 'b>(
9896
&'a self,
99-
filter: &'a dyn TestFilter,
100-
) -> impl Iterator<Item = &Function> {
97+
filter: &'b dyn TestFilter,
98+
) -> impl Iterator<Item = &'a Function> + 'b {
10199
self.matching_contracts(filter)
102100
.flat_map(|(_, c)| c.abi.functions())
103101
.filter(|func| is_matching_test(func, filter))
104102
}
105103

106104
/// Returns an iterator over all test functions in contracts that match the filter.
107-
pub fn all_test_functions<'a>(
105+
pub fn all_test_functions<'a: 'b, 'b>(
108106
&'a self,
109-
filter: &'a dyn TestFilter,
110-
) -> impl Iterator<Item = &Function> {
107+
filter: &'b dyn TestFilter,
108+
) -> impl Iterator<Item = &'a Function> + 'b {
111109
self.contracts
112110
.iter()
113111
.filter(|(id, _)| filter.matches_path(&id.source) && filter.matches_contract(&id.name))

0 commit comments

Comments
 (0)