Merged
Conversation
camelid
commented
Dec 5, 2020
bjorn3
reviewed
Dec 5, 2020
Contributor
|
Thanks for taking a look at this. The second 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 @@ fn lints_from_file(&self, path: &Path) -> Result<Vec<Lint>, Box<dyn Error>> {
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. |
Member
Author
|
@ehuss Could you explain why you prefer that change over this one? |
Contributor
|
It's just an opinion that it keeps the code simpler. There's no reason to differentiate between start/end trimming, so just the simple |
It was removing all the indentation before. Co-authored-by: Eric Huss <eric@huss.org>
31333de to
b4b66f6
Compare
Member
Author
|
Ah, I think I got mixed up and thought that what you suggested wouldn't work. I applied your patch. This should be ready to merge now! |
Member
|
@bors r+ rollup |
Collaborator
|
📌 Commit b4b66f6 has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 9, 2020
Rollup of 12 pull requests Successful merges: - rust-lang#79732 (minor stylistic clippy cleanups) - rust-lang#79750 (Fix trimming of lint docs) - rust-lang#79777 (Remove `first_merge` from liveness debug logs) - rust-lang#79795 (Privatize some of libcore unicode_internals) - rust-lang#79803 (Update xsv to prevent random CI failures) - rust-lang#79810 (Account for gaps in def path table during decoding) - rust-lang#79818 (Fixes to Rust coverage) - rust-lang#79824 (Strip prefix instead of replacing it with empty string) - rust-lang#79826 (Simplify visit_{foreign,trait}_item) - rust-lang#79844 (Move RWUTable to a separate module) - rust-lang#79861 (Update LLVM submodule) - rust-lang#79862 (Remove tab-lock and replace it with ctrl+up/down arrows to switch between search result tabs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #79748.
It was removing all the indentation before.
r? @Mark-Simulacrum