-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip 1st line in path macro description expansion (#881)
Previously, the entire doc comment was used as the description, in addition to the summary using the first line of the doc comment, resulting in duplicated text. This commit changes the path macro doc comment extraction logic to split the first line from the rest of the body, and skip all lines until the first non-whitespace line. This results in the description no longer containing the summary. In degenerate cases, such as a doc comment consisting of new lines, this will invoke a full linear search over all lines in the doc comment. This should be relatively acceptable as most reasonable forms of doc comments shouldn't have more than a couple of newlines between the first line and subsequent body. For testing and verification, I've tested this in a private project using the `patch` override section in `Cargo.toml`, and tests needed to be changed to account for this change.
- Loading branch information
1 parent
365469f
commit 5aa9749
Showing
3 changed files
with
24 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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