Skip to content

Commit df2df14

Browse files
Simplify docfragment transformation in unindent tests
1 parent d0e7523 commit df2df14

File tree

1 file changed

+1
-14
lines changed
  • src/librustdoc/passes/unindent_comments

1 file changed

+1
-14
lines changed

src/librustdoc/passes/unindent_comments/tests.rs

+1-14
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,7 @@ fn run_test(input: &str, expected: &str) {
2020
with_default_session_globals(|| {
2121
let mut s = create_doc_fragment(input);
2222
unindent_fragments(&mut s);
23-
assert_eq!(
24-
&s[0]
25-
.doc
26-
.as_str()
27-
.lines()
28-
.map(|l| if l.len() > s[0].indent {
29-
l[s[0].indent..].to_string()
30-
} else {
31-
String::new()
32-
})
33-
.collect::<Vec<_>>()
34-
.join("\n"),
35-
expected
36-
);
23+
assert_eq!(&s.iter().collect::<String>(), expected);
3724
});
3825
}
3926

0 commit comments

Comments
 (0)