Rollup merge of #79750 - camelid:fix-lint-docs-trimming, r=Mark-Simulacrum

Fix trimming of lint docs

Fixes #79748.

It was removing all the indentation before.

r? `@Mark-Simulacrum`
This commit is contained in:
Tyler Mandry 2020-12-09 13:38:18 -08:00 committed by GitHub
commit 287293732f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.