diff options
| author | nils <48135649+Nilstrieb@users.noreply.github.com> | 2022-12-19 08:48:30 +0100 |
|---|---|---|
| committer | nils <48135649+Nilstrieb@users.noreply.github.com> | 2022-12-19 08:58:40 +0100 |
| commit | 5fb2d63d0793a4c3c612d1e4a4ca6a184e6fe614 (patch) | |
| tree | db18507b08639299650830aa63169ec86e9e6798 /library/test/src/formatters | |
| parent | 224fa3907e319405fdabdb06c33f99b896754773 (diff) | |
Fix `uninlined_format_args` in libtest
Diffstat (limited to 'library/test/src/formatters')
| -rw-r--r-- | library/test/src/formatters/json.rs | 7 | ||||
| -rw-r--r-- | library/test/src/formatters/mod.rs | 2 | ||||
| -rw-r--r-- | library/test/src/formatters/pretty.rs | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/library/test/src/formatters/json.rs b/library/test/src/formatters/json.rs index c07fdafb167..5526aadb67f 100644 --- a/library/test/src/formatters/json.rs +++ b/library/test/src/formatters/json.rs @@ -53,7 +53,7 @@ impl<T: Write> JsonFormatter<T> { self.write_message(&*format!(r#", "stdout": "{}""#, EscapedString(stdout)))?; } if let Some(extra) = extra { - self.write_message(&*format!(r#", {}"#, extra))?; + self.write_message(&*format!(r#", {extra}"#))?; } self.writeln_message(" }") } @@ -62,13 +62,12 @@ impl<T: Write> JsonFormatter<T> { impl<T: Write> OutputFormatter for JsonFormatter<T> { fn write_run_start(&mut self, test_count: usize, shuffle_seed: Option<u64>) -> io::Result<()> { let shuffle_seed_json = if let Some(shuffle_seed) = shuffle_seed { - format!(r#", "shuffle_seed": {}"#, shuffle_seed) + format!(r#", "shuffle_seed": {shuffle_seed}"#) } else { String::new() }; self.writeln_message(&*format!( - r#"{{ "type": "suite", "event": "started", "test_count": {}{} }}"#, - test_count, shuffle_seed_json + r#"{{ "type": "suite", "event": "started", "test_count": {test_count}{shuffle_seed_json} }}"# )) } diff --git a/library/test/src/formatters/mod.rs b/library/test/src/formatters/mod.rs index cb80859759f..cb67b6491a3 100644 --- a/library/test/src/formatters/mod.rs +++ b/library/test/src/formatters/mod.rs @@ -38,5 +38,5 @@ pub(crate) fn write_stderr_delimiter(test_output: &mut Vec<u8>, test_name: &Test Some(_) => test_output.push(b'\n'), None => (), } - writeln!(test_output, "---- {} stderr ----", test_name).unwrap(); + writeln!(test_output, "---- {test_name} stderr ----").unwrap(); } diff --git a/library/test/src/formatters/pretty.rs b/library/test/src/formatters/pretty.rs index 69420222980..0299c8b5433 100644 --- a/library/test/src/formatters/pretty.rs +++ b/library/test/src/formatters/pretty.rs @@ -47,7 +47,7 @@ impl<T: Write> PrettyFormatter<T> { pub fn write_ignored(&mut self, message: Option<&'static str>) -> io::Result<()> { if let Some(message) = message { - self.write_short_result(&format!("ignored, {}", message), term::color::YELLOW) + self.write_short_result(&format!("ignored, {message}"), term::color::YELLOW) } else { self.write_short_result("ignored", term::color::YELLOW) } |
