Skip to content

Commit

Permalink
refactor(cli)!: use elided lifetimes for fmt. API
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Oct 23, 2023
1 parent caabd46 commit 894e866
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/bin/moz-webgpu-cts/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@ pub type Test = metadata::Test<AnalyzeableProps<TestOutcome>, AnalyzeableProps<S

pub type Subtest = metadata::Subtest<AnalyzeableProps<SubtestOutcome>>;

pub fn format_file<'a>(
file: &'a metadata::File<AnalyzeableProps<TestOutcome>, AnalyzeableProps<SubtestOutcome>>,
) -> impl Display + 'a {
pub fn format_file(file: &File) -> impl Display + '_ {
lazy_format!(|f| {
let metadata::File { tests } = file;
write!(f, "{}", tests.iter().map(format_test).join_with("\n\n"))
})
}

fn format_test<'a>(test: &'a Test) -> impl Display + 'a {
fn format_test(test: &Test) -> impl Display + '_ {
lazy_format!(|f| {
let Test {
name,
Expand Down Expand Up @@ -68,10 +66,7 @@ fn format_test<'a>(test: &'a Test) -> impl Display + 'a {
})
}

fn format_properties<'a, Out>(
indentation: u8,
property: &'a AnalyzeableProps<Out>,
) -> impl Display + 'a
fn format_properties<Out>(indentation: u8, property: &AnalyzeableProps<Out>) -> impl Display + '_
where
Out: Display,
{
Expand Down Expand Up @@ -125,7 +120,7 @@ where
"{indent} if {}: {}",
platform
.as_ref()
.map(|p| -> &dyn Display { &*p })
.map(|p| -> &dyn Display { p })
.into_iter()
.chain(
build_profile
Expand All @@ -149,7 +144,7 @@ where
})
}

fn format_exp<'a, Exp>(exp: &'a Expectation<Exp>) -> impl Display + 'a
fn format_exp<Exp>(exp: &Expectation<Exp>) -> impl Display + '_
where
Exp: Display,
{
Expand Down

0 comments on commit 894e866

Please sign in to comment.