Skip to content

Commit d4eb25c

Browse files
author
Ariel Ben-Yehuda
authored
Rollup merge of rust-lang#40293 - malbarbo:rustdoctest, r=alexcrichton
Remove extra space in test description (of a mod test)
2 parents 949eafe + 2e5b380 commit d4eb25c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/librustdoc/test.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,11 @@ impl Collector {
422422
as_test_harness: bool, compile_fail: bool, error_codes: Vec<String>,
423423
line: usize, filename: String) {
424424
let name = if self.use_headers {
425-
let s = self.current_header.as_ref().map(|s| &**s).unwrap_or("");
426-
format!("{} - {} (line {})", filename, s, line)
425+
if let Some(ref header) = self.current_header {
426+
format!("{} - {} (line {})", filename, header, line)
427+
} else {
428+
format!("{} - (line {})", filename, line)
429+
}
427430
} else {
428431
format!("{} - {} (line {})", filename, self.names.join("::"), line)
429432
};

0 commit comments

Comments
 (0)