Make getopts count (and thus align/linewrap) in terms of codepoints not ...#8710
Closed
pnkfelix wants to merge 3 commits intorust-lang:masterfrom
Closed
Make getopts count (and thus align/linewrap) in terms of codepoints not ...#8710pnkfelix wants to merge 3 commits intorust-lang:masterfrom
pnkfelix wants to merge 3 commits intorust-lang:masterfrom
Conversation
Contributor
|
Could you add a FIXME here noting that it still isn't completely right? It really needs to use graphemes + check for double-width characters to be 100% accurate. Of course, we currently lack the Unicode tables required to do that. |
Contributor
Author
|
There are already FIXME's in the code in question. I'll check if they can use further elaboration. |
Also added regression test for the byte vs codepoint issues that the previous commit fixes.
src/libextra/getopts.rs
Outdated
Member
There was a problem hiding this comment.
Is there a reason that this isn't row.char_len()?
Other than that, r=me
Contributor
Author
There was a problem hiding this comment.
none other than count_chars is the first one my searches through str.rs found. Will fix.
bors
added a commit
that referenced
this pull request
Aug 25, 2013
…excrichton ...bytes. (removing previous note about eff-eye-ex'ing #5516 since it actually does not do so, it just gets us half-way.)
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
May 1, 2025
…st-lang#14504) Closes rust-lang#8710 changelog: [`equatable_if_let`] fix wrong suggestions when involving reference
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.
...bytes.
(removing previous note about eff-eye-ex'ing #5516 since it actually does not do so, it just gets us half-way.)