use bool.then

This commit is contained in:
yt2b 2022-11-24 09:23:20 +09:00
parent 492f09298f
commit e8200ab674

View file

@ -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.