mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-20 03:25:18 +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> {
|
||||
let take_char = Lexer::<T>::is_digit_of_radix(self.window[0], radix);
|
||||
|
||||
if take_char {
|
||||
Some(self.next_char().unwrap())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
take_char.then(|| self.next_char().unwrap())
|
||||
}
|
||||
|
||||
/// Test if a digit is of a certain radix.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue