From 7f18d7a85168e02b0da51abfdeedcd1c5e96db0c Mon Sep 17 00:00:00 2001 From: RageKnify Date: Thu, 13 Jan 2022 21:28:17 +0100 Subject: [PATCH] Refactor: optimize println!() Clippy 1.58.0 complains about `format!()` inside `println!()` being inefficient --- boa_tester/src/results.rs | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/boa_tester/src/results.rs b/boa_tester/src/results.rs index f906ae34a1..57bddab29e 100644 --- a/boa_tester/src/results.rs +++ b/boa_tester/src/results.rs @@ -253,24 +253,21 @@ pub(crate) fn compare_results(base: &Path, new: &Path, markdown: bool) { diff_format(panic_diff), ); println!( - "| Conformance | {:.2}% | {:.2}% | {} |", + "| Conformance | {:.2}% | {:.2}% | {}{}{:.2}%{} |", base_conformance, new_conformance, - format!( - "{}{}{:.2}%{}", - if conformance_diff.abs() > f64::EPSILON { - "**" - } else { - "" - }, - if conformance_diff > 0_f64 { "+" } else { "" }, - conformance_diff, - if conformance_diff.abs() > f64::EPSILON { - "**" - } else { - "" - }, - ), + if conformance_diff.abs() > f64::EPSILON { + "**" + } else { + "" + }, + if conformance_diff > 0_f64 { "+" } else { "" }, + conformance_diff, + if conformance_diff.abs() > f64::EPSILON { + "**" + } else { + "" + }, ); if !test_diff.fixed.is_empty() {