Small fixme in core now that split_first has no codegen issues · model-checking/verify-rust-std@2b8c7a3 (original) (raw)
2 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -39,9 +39,7 @@ impl ByteSlice for [u8] { | ||
39 | 39 | fn parse_digits(&self, mut func: impl FnMut(u8)) -> &Self { |
40 | 40 | let mut s = self; |
41 | 41 | |
42 | -// FIXME: Can't use s.split_first() here yet, | |
43 | -// see https://github.com/rust-lang/rust/issues/109328 | |
44 | -while let [c, s_next @ ..] = s { | |
42 | +while let Some((c, s_next)) = s.split_first() { | |
45 | 43 | let c = c.wrapping_sub(b'0'); |
46 | 44 | if c < 10 { |
47 | 45 | func(c); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -51,9 +51,7 @@ fn try_parse_19digits(s_ref: &mut &[u8], x: &mut u64) { | ||
51 | 51 | let mut s = *s_ref; |
52 | 52 | |
53 | 53 | while *x < MIN_19DIGIT_INT { |
54 | -// FIXME: Can't use s.split_first() here yet, | |
55 | -// see https://github.com/rust-lang/rust/issues/109328 | |
56 | -if let [c, s_next @ ..] = s { | |
54 | +if let Some((c, s_next)) = s.split_first() { | |
57 | 55 | let digit = c.wrapping_sub(b'0'); |
58 | 56 | |
59 | 57 | if digit < 10 { |