mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-20 11:35:20 +00:00
use bool.then
This commit is contained in:
parent
492f09298f
commit
e8200ab674
1 changed files with 1 additions and 5 deletions
|
@ -438,11 +438,7 @@ where
|
||||||
fn take_number(&mut self, radix: u32) -> Option<char> {
|
fn take_number(&mut self, radix: u32) -> Option<char> {
|
||||||
let take_char = Lexer::<T>::is_digit_of_radix(self.window[0], radix);
|
let take_char = Lexer::<T>::is_digit_of_radix(self.window[0], radix);
|
||||||
|
|
||||||
if take_char {
|
take_char.then(|| self.next_char().unwrap())
|
||||||
Some(self.next_char().unwrap())
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Test if a digit is of a certain radix.
|
/// Test if a digit is of a certain radix.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue