diff options
author | Lars Wirzenius <liw@liw.fi> | 2023-02-11 14:33:17 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2023-02-11 14:33:17 +0200 |
commit | 78325817028096ca134b7c2bbd3bc6ca000a8f3e (patch) | |
tree | b373d1d9d781f16825bc91748978b5b49ac36879 /examples | |
parent | b6df0fa5b7046bad97f63dc928a9776cecaee623 (diff) | |
download | subplot-78325817028096ca134b7c2bbd3bc6ca000a8f3e.tar.gz |
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
Diffstat (limited to 'examples')
-rw-r--r-- | examples/seq/seq-extras.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/examples/seq/seq-extras.rs b/examples/seq/seq-extras.rs index 79863fc..b2185fb 100644 --- a/examples/seq/seq-extras.rs +++ b/examples/seq/seq-extras.rs @@ -26,8 +26,7 @@ fn count_lines_in_stdout(context: &Runcmd, count: usize) { // step error. This will be reported as the reason the // scenario fails. throw!(format!( - "Incorrect number of lines, got {} expected {}", - stdout_count, count + "Incorrect number of lines, got {stdout_count} expected {count}", )); } } @@ -57,8 +56,7 @@ fn stderr_contains_two_things(context: &ScenarioContext, what: &str, other: &str if !stderr_has_both { throw!(format!( - "Stderr does not contain both of {:?} and {:?}", - what, other + "Stderr does not contain both of {what:?} and {other:?}", )) } } |