Replace custom trim_ascii_start with the standard library method#155134
Open
thebabalola wants to merge 2 commits intorust-lang:mainfrom
Open
Replace custom trim_ascii_start with the standard library method#155134thebabalola wants to merge 2 commits intorust-lang:mainfrom
thebabalola wants to merge 2 commits intorust-lang:mainfrom
Conversation
The local trim_ascii_start function in the markdown parser duplicates <[u8]>::trim_ascii_start() from the standard library (stable since 1.80). Remove the custom function and call the stdlib method directly. No behaviour change. Fixes rustfoundation/interop-initiative#53
Collaborator
|
r? @mati865 rustbot has assigned @mati865. Use Why was this reviewer chosen?The reviewer was selected based on:
|
13 tasks
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.
The markdown parser in
rustc_errorshas a localtrim_ascii_startfunction that strips leading ASCII whitespace from a byte slice. The standard library has had<[u8]>::trim_ascii_start()since Rust 1.80, which does the same thing.This PR removes the custom function and calls the stdlib method directly in
parse_unordered_liandparse_ordered_li. No behaviour change.I also added a test covering the list item leading-whitespace trimming behaviour, including a tab case (with
#[rustfmt::skip]).Fixes rustfoundation/interop-initiative#53