Skip to content

Commit

Permalink
Small fixme in core now that split_first has no codegen issues
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigorenkoPV committed Jun 24, 2024
1 parent c26bd79 commit 2b8c7a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions core/src/num/dec2flt/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ impl ByteSlice for [u8] {
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);
Expand Down
4 changes: 1 addition & 3 deletions core/src/num/dec2flt/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2b8c7a3

Please sign in to comment.