diff options
| author | The8472 <git@infinite-source.de> | 2021-09-11 12:29:34 +0200 |
|---|---|---|
| committer | The8472 <git@infinite-source.de> | 2021-09-11 12:29:34 +0200 |
| commit | 5e1428e18be47b48c5c94d6e067d24f44074cd32 (patch) | |
| tree | bfc59b0ada05691399ed317cc134b7bd3928e4f5 | |
| parent | 66195d8bc4c2e29cd0c894441c3497b2281251b8 (diff) | |
| download | rust-5e1428e18be47b48c5c94d6e067d24f44074cd32.tar.gz rust-5e1428e18be47b48c5c94d6e067d24f44074cd32.zip | |
manually inline function
| -rw-r--r-- | library/core/src/str/validations.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/core/src/str/validations.rs b/library/core/src/str/validations.rs index a078bf92a27..093c9c37b60 100644 --- a/library/core/src/str/validations.rs +++ b/library/core/src/str/validations.rs @@ -163,7 +163,7 @@ pub(super) fn run_utf8_validation(v: &[u8]) -> Result<(), Utf8Error> { // %xF4 %x80-8F 2( UTF8-tail ) match w { 2 => { - if !utf8_is_cont_byte(next!()) { + if next!() as i8 >= -64 { err!(Some(1)) } } @@ -175,7 +175,7 @@ pub(super) fn run_utf8_validation(v: &[u8]) -> Result<(), Utf8Error> { | (0xEE..=0xEF, 0x80..=0xBF) => {} _ => err!(Some(1)), } - if !utf8_is_cont_byte(next!()) { + if next!() as i8 >= -64 { err!(Some(2)) } } @@ -184,10 +184,10 @@ pub(super) fn run_utf8_validation(v: &[u8]) -> Result<(), Utf8Error> { (0xF0, 0x90..=0xBF) | (0xF1..=0xF3, 0x80..=0xBF) | (0xF4, 0x80..=0x8F) => {} _ => err!(Some(1)), } - if !utf8_is_cont_byte(next!()) { + if next!() as i8 >= -64 { err!(Some(2)) } - if !utf8_is_cont_byte(next!()) { + if next!() as i8 >= -64 { err!(Some(3)) } } |
