Skip to content

Commit 33d2c87

Browse files
committed
apply review2 changes
1 parent 9fcac4e commit 33d2c87

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_builtin_macros/src/format_foreign.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ pub(crate) mod printf {
421421
state = Prec;
422422
parameter = None;
423423
flags = "";
424-
width = at.slice_between(end).map(|num| Num::from_str(num, None));
424+
width = at.slice_between(end).and_then(|num| Num::from_str(num, None));
425425
if width.is_none() {
426426
return fallback();
427427
}
@@ -455,7 +455,7 @@ pub(crate) mod printf {
455455
'1'..='9' => {
456456
let end = at_next_cp_while(next, char::is_ascii_digit);
457457
state = Prec;
458-
width = at.slice_between(end).map(|num| Num::from_str(num, None));
458+
width = at.slice_between(end).and_then(|num| Num::from_str(num, None));
459459
if width.is_none() {
460460
return fallback();
461461
}
@@ -519,7 +519,7 @@ pub(crate) mod printf {
519519
'0'..='9' => {
520520
let end = at_next_cp_while(next, char::is_ascii_digit);
521521
state = Length;
522-
precision = at.slice_between(end).map(|num| Num::from_str(num, None));
522+
precision = at.slice_between(end).and_then(|num| Num::from_str(num, None));
523523
move_to!(end);
524524
}
525525
_ => return fallback(),

0 commit comments

Comments
 (0)