about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamelid <camelidcamel@gmail.com>2020-12-06 14:11:02 -0800
committerCamelid <camelidcamel@gmail.com>2020-12-06 14:11:02 -0800
commitb4b66f6e2443cd05e163ac2577620ed06ea265e9 (patch)
tree9ef63d48c3a516bfad87d08bf41814867e9f522b
parent5bb68c31f8cef24174a7d3499de6b4ebea069900 (diff)
downloadrust-b4b66f6e2443cd05e163ac2577620ed06ea265e9.tar.gz
rust-b4b66f6e2443cd05e163ac2577620ed06ea265e9.zip
Fix trimming of lint docs
It was removing all the indentation before.

Co-authored-by: Eric Huss <eric@huss.org>
-rw-r--r--src/tools/lint-docs/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/lint-docs/src/lib.rs b/src/tools/lint-docs/src/lib.rs
index 326b7948098..ea54a351e03 100644
--- a/src/tools/lint-docs/src/lib.rs
+++ b/src/tools/lint-docs/src/lib.rs
@@ -143,8 +143,8 @@ impl<'a> LintExtractor<'a> {
                     Some((lineno, line)) => {
                         let line = line.trim();
                         if let Some(text) = line.strip_prefix("/// ") {
-                            doc_lines.push(text.trim().to_string());
-                        } else if line.starts_with("///") {
+                            doc_lines.push(text.to_string());
+                        } else if line == "///" {
                             doc_lines.push("".to_string());
                         } else if line.starts_with("// ") {
                             // Ignore comments.