We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
collect
1 parent 72e74d7 commit 48438ceCopy full SHA for 48438ce
src/librustdoc/doctest.rs
@@ -395,7 +395,7 @@ fn run_test(
395
eprint!("{}", self.0);
396
}
397
398
- let mut out_lines = str::from_utf8(&output.stderr)
+ let mut out = str::from_utf8(&output.stderr)
399
.unwrap()
400
.lines()
401
.filter(|l| {
@@ -406,15 +406,15 @@ fn run_test(
406
true
407
408
})
409
- .collect::<Vec<_>>();
+ .intersperse_with(|| "\n")
410
+ .collect::<String>();
411
412
// Add a \n to the end to properly terminate the last line,
413
// but only if there was output to be printed
- if !out_lines.is_empty() {
414
- out_lines.push("");
+ if !out.is_empty() {
415
+ out.push('\n');
416
417
- let out = out_lines.join("\n");
418
let _bomb = Bomb(&out);
419
match (output.status.success(), lang_string.compile_fail) {
420
(true, true) => {
0 commit comments