Skip to content

Commit 1ba104c

Browse files
committed
In rustup-mock's print_indented, add line counts
I think this is useful to help understand how two multi-line strings are different.
1 parent 0990c1e commit 1ba104c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/rustup-mock/src/clitools.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,12 @@ fn print_command(args: &[&str], out: &SanitizedOutput) {
269269
}
270270

271271
fn print_indented(heading: &str, text: &str) {
272-
println!("{}:\n {}", heading, text.replace("\n", "\n "));
272+
println!(
273+
"{} ({} lines):\n {}",
274+
heading,
275+
text.lines().count(),
276+
text.replace("\n", "\n ")
277+
);
273278
}
274279

275280
#[derive(Debug)]

0 commit comments

Comments
 (0)