-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correctly estimate the required space for string in StyledBuffer::prepend
#65120
Conversation
`.len()` returns length in bytes so it overestimates the required space
...And let's just hope that it will not introduce one more stable-to-nightly regression. |
r=me after testing locally against the three cases requested. |
With combining character:
With zero width character (there is a zero-width non-joiner between
With full-width characters:
With example from Manish's blog:
Kudos to @kpp for actually carrying out the check. |
@bors r+ |
📌 Commit 4414068 has been approved by |
Correctly estimate the required space for string in `StyledBuffer::prepend` Fix rust-lang#65119 r? @estebank
Correctly estimate the required space for string in `StyledBuffer::prepend` Fix rust-lang#65119 r? @estebank
Correctly estimate the required space for string in `StyledBuffer::prepend` Fix rust-lang#65119 r? @estebank
Rollup of 8 pull requests Successful merges: - #64404 (Add long error explanation for E0495) - #64918 (Add long error explanation for E0551) - #65102 (Disable stack probe when thread sanitizer is enabled) - #65120 (Correctly estimate the required space for string in `StyledBuffer::prepend`) - #65145 (When suggesting assoc function with type params, include turbofish) - #65162 (Remove loaded_from_cache map from DepGraph) - #65176 (Remove query-related macros) - #65179 (Add long error explanation for E0567) Failed merges: r? @ghost
Fix #65119
r? @estebank