Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7f0bb45

Browse files
authored
Rollup merge ofrust-lang#126906 - GrigorenkoPV:fixme-split_at_first, r=Mark-Simulacrum
Small fixme in core now that split_first has no codegen issuesrust-lang#109328 (comment)BTW, I have a crate implementing exactly this kind of an iterator:https://github.com/GrigorenkoPV/head-tail-iter and I was wondering if it would be worthwhile to try and make an ACP for it to get it included in std (or maybe itertools). My only doubt is that it kinda incentives writing O(n^2) algorithms and is not the hard to replace with a `while let` loop (just as in this PR).
2 parentsb0feb54 +2b8c7a3 commit7f0bb45

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

‎core/src/num/dec2flt/common.rs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ impl ByteSlice for [u8] {
3939
fnparse_digits(&self,mutfunc:implFnMut(u8)) ->&Self{
4040
letmut s =self;
4141

42-
// FIXME: Can't use s.split_first() here yet,
43-
// see https://github.com/rust-lang/rust/issues/109328
44-
whilelet[c, s_next @ ..] = s{
42+
whileletSome((c, s_next)) = s.split_first(){
4543
let c = c.wrapping_sub(b'0');
4644
if c <10{
4745
func(c);

‎core/src/num/dec2flt/parse.rs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ fn try_parse_19digits(s_ref: &mut &[u8], x: &mut u64) {
5151
letmut s =*s_ref;
5252

5353
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-
iflet[c, s_next @ ..] = s{
54+
ifletSome((c, s_next)) = s.split_first(){
5755
let digit = c.wrapping_sub(b'0');
5856

5957
if digit <10{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp