Skip to content

Commit

Permalink
apply review2 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pymongo committed May 18, 2024
1 parent 9fcac4e commit 33d2c87
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_builtin_macros/src/format_foreign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ pub(crate) mod printf {
state = Prec;
parameter = None;
flags = "";
width = at.slice_between(end).map(|num| Num::from_str(num, None));
width = at.slice_between(end).and_then(|num| Num::from_str(num, None));
if width.is_none() {
return fallback();
}
Expand Down Expand Up @@ -455,7 +455,7 @@ pub(crate) mod printf {
'1'..='9' => {
let end = at_next_cp_while(next, char::is_ascii_digit);
state = Prec;
width = at.slice_between(end).map(|num| Num::from_str(num, None));
width = at.slice_between(end).and_then(|num| Num::from_str(num, None));
if width.is_none() {
return fallback();
}
Expand Down Expand Up @@ -519,7 +519,7 @@ pub(crate) mod printf {
'0'..='9' => {
let end = at_next_cp_while(next, char::is_ascii_digit);
state = Length;
precision = at.slice_between(end).map(|num| Num::from_str(num, None));
precision = at.slice_between(end).and_then(|num| Num::from_str(num, None));
move_to!(end);
}
_ => return fallback(),
Expand Down

0 comments on commit 33d2c87

Please sign in to comment.