-
Notifications
You must be signed in to change notification settings - Fork 13.3k
core: minor refactoring of run_utf8_validation #108217
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
Conversation
* Use `utf8_is_cont_byte` instead of `(byte as i8) > -64`. The former is **much more** descriptive. This was the main motivation for this commit. * Use `[T]::get` in favour of explicit length check which is more concise. * Put ‘is continuation byte’ checking inside of a macro to reduce repetition. * Replace `next!` macro by macros getting by offset so that the offset doesn’t have to be repeated in invocation of `err!`.
r? @m-ou-se (rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
note that there's a bigger rewrite happening in #107760 |
The job Click to see the possible cause of the failure (guessed by this bot)
|
utf8_is_cont_byte
instead of(byte as i8) > -64
. The formeris much more descriptive. This was the main motivation for this
commit.
[T]::get
in favour of explicit length check which is moreconcise.
repetition.
next!
macro by macros getting by offset so that the offsetdoesn’t have to be repeated in invocation of
err!
.