We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c26bd79 commit 2b8c7a3Copy full SHA for 2b8c7a3
core/src/num/dec2flt/common.rs
@@ -39,9 +39,7 @@ impl ByteSlice for [u8] {
39
fn parse_digits(&self, mut func: impl FnMut(u8)) -> &Self {
40
let mut s = self;
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 {
+ while let Some((c, s_next)) = s.split_first() {
45
let c = c.wrapping_sub(b'0');
46
if c < 10 {
47
func(c);
core/src/num/dec2flt/parse.rs
@@ -51,9 +51,7 @@ fn try_parse_19digits(s_ref: &mut &[u8], x: &mut u64) {
51
let mut s = *s_ref;
52
53
while *x < MIN_19DIGIT_INT {
54
55
56
- if let [c, s_next @ ..] = s {
+ if let Some((c, s_next)) = s.split_first() {
57
let digit = c.wrapping_sub(b'0');
58
59
if digit < 10 {
0 commit comments