@@ -30,14 +30,13 @@ mod cursor;
3030#[ cfg( test) ]
3131mod tests;
3232
33+ use LiteralKind :: * ;
34+ use TokenKind :: * ;
35+ use cursor:: EOF_CHAR ;
36+ pub use cursor:: { Cursor , FrontmatterAllowed } ;
3337use unicode_properties:: UnicodeEmoji ;
3438pub use unicode_xid:: UNICODE_VERSION as UNICODE_XID_VERSION ;
3539
36- use self :: LiteralKind :: * ;
37- use self :: TokenKind :: * ;
38- use crate :: cursor:: EOF_CHAR ;
39- pub use crate :: cursor:: { Cursor , FrontmatterAllowed } ;
40-
4140/// Parsed token.
4241/// It doesn't contain information about data that has been parsed,
4342/// only the type of the token and its size.
@@ -372,9 +371,8 @@ pub fn is_ident(string: &str) -> bool {
372371impl Cursor < ' _ > {
373372 /// Parses a token from the input string.
374373 pub fn advance_token ( & mut self ) -> Token {
375- let first_char = match self . bump ( ) {
376- Some ( c) => c,
377- None => return Token :: new ( TokenKind :: Eof , 0 ) ,
374+ let Some ( first_char) = self . bump ( ) else {
375+ return Token :: new ( TokenKind :: Eof , 0 ) ;
378376 } ;
379377
380378 let token_kind = match first_char {
@@ -788,7 +786,7 @@ impl Cursor<'_> {
788786 } else {
789787 // No base prefix, parse number in the usual way.
790788 self . eat_decimal_digits ( ) ;
791- } ;
789+ }
792790
793791 match self . first ( ) {
794792 // Don't be greedy if this is actually an
0 commit comments