Skip to content

Commit e8200ab

Browse files
committed
use bool.then
1 parent 492f092 commit e8200ab

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎parser/src/lexer.rs‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,7 @@ where
438438
fn take_number(&mut self, radix: u32) -> Option<char> {
439439
let take_char = Lexer::<T>::is_digit_of_radix(self.window[0], radix);
440440

441-
if take_char {
442-
Some(self.next_char().unwrap())
443-
} else {
444-
None
445-
}
441+
take_char.then(|| self.next_char().unwrap())
446442
}
447443

448444
/// Test if a digit is of a certain radix.

0 commit comments

Comments
 (0)