Small fixme in core now that split_first has no codegen issues

This commit is contained in:
Pavel Grigorenko 2024-06-24 17:57:58 +03:00
parent 06c072f158
commit 39bf1dcce5
2 changed files with 2 additions and 6 deletions

View file

@ -39,9 +39,7 @@ fn offset_from(&self, other: &Self) -> isize {
fn parse_digits(&self, mut func: impl FnMut(u8)) -> &Self {
let mut s = self;
// FIXME: Can't use s.split_first() here yet,
// see https://github.com/rust-lang/rust/issues/109328
while let [c, s_next @ ..] = s {
while let Some((c, s_next)) = s.split_first() {
let c = c.wrapping_sub(b'0');
if c < 10 {
func(c);

View file

@ -51,9 +51,7 @@ fn try_parse_19digits(s_ref: &mut &[u8], x: &mut u64) {
let mut s = *s_ref;
while *x < MIN_19DIGIT_INT {
// FIXME: Can't use s.split_first() here yet,
// see https://github.com/rust-lang/rust/issues/109328
if let [c, s_next @ ..] = s {
if let Some((c, s_next)) = s.split_first() {
let digit = c.wrapping_sub(b'0');
if digit < 10 {