From 78325817028096ca134b7c2bbd3bc6ca000a8f3e Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 11 Feb 2023 14:33:17 +0200 Subject: chore: use variables in Rust format strings Change this: format!("{}", foo) into this: format!("{foo}") Support for this feature was added in Rust 1.58 (see https://github.com/rust-lang/rust/releases/tag/1.58.0) and in 1.67 clippy suggests about this. Because the new style seems to be where the Rust ecosystem is going, I think Subplot should follow to avoid being needlessly different from most other projects. Sponsored-by: author --- tests/bindings-ubm.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/bindings-ubm.rs b/tests/bindings-ubm.rs index dc3be19..0ee59e5 100644 --- a/tests/bindings-ubm.rs +++ b/tests/bindings-ubm.rs @@ -16,7 +16,7 @@ fn bindings_microbenchmark() { let mut texts = vec![]; for i in 0..N { - texts.push(format!("step {}", i)); + texts.push(format!("step {i}")); } let texted = time.elapsed().unwrap(); @@ -24,7 +24,7 @@ fn bindings_microbenchmark() { for t in texts.iter() { re.push(( t, - RegexBuilder::new(&format!("^{}$", t)) + RegexBuilder::new(&format!("^{t}$")) .case_insensitive(false) .build() .unwrap(), -- cgit v1.2.1