about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-12-27 23:57:45 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2021-01-02 19:16:27 +0100
commitdf2df14424b6fa3b2b2a8a8cdd6cb2307ddbb474 (patch)
treec3b40ee96ce7f6f6229b3f70ada6a6788c252d43
parentd0e7523a3246a36d6647f60e5bd75d9e3c71280e (diff)
downloadrust-df2df14424b6fa3b2b2a8a8cdd6cb2307ddbb474.tar.gz
rust-df2df14424b6fa3b2b2a8a8cdd6cb2307ddbb474.zip
Simplify docfragment transformation in unindent tests
-rw-r--r--src/librustdoc/passes/unindent_comments/tests.rs15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/librustdoc/passes/unindent_comments/tests.rs b/src/librustdoc/passes/unindent_comments/tests.rs
index ca8f6921fdc..9c9924841b9 100644
--- a/src/librustdoc/passes/unindent_comments/tests.rs
+++ b/src/librustdoc/passes/unindent_comments/tests.rs
@@ -20,20 +20,7 @@ fn run_test(input: &str, expected: &str) {
     with_default_session_globals(|| {
         let mut s = create_doc_fragment(input);
         unindent_fragments(&mut s);
-        assert_eq!(
-            &s[0]
-                .doc
-                .as_str()
-                .lines()
-                .map(|l| if l.len() > s[0].indent {
-                    l[s[0].indent..].to_string()
-                } else {
-                    String::new()
-                })
-                .collect::<Vec<_>>()
-                .join("\n"),
-            expected
-        );
+        assert_eq!(&s.iter().collect::<String>(), expected);
     });
 }