@@ -30,14 +30,13 @@ mod cursor;
30
30
#[ cfg( test) ]
31
31
mod tests;
32
32
33
+ use LiteralKind :: * ;
34
+ use TokenKind :: * ;
35
+ use cursor:: EOF_CHAR ;
36
+ pub use cursor:: { Cursor , FrontmatterAllowed } ;
33
37
use unicode_properties:: UnicodeEmoji ;
34
38
pub use unicode_xid:: UNICODE_VERSION as UNICODE_XID_VERSION ;
35
39
36
- use self :: LiteralKind :: * ;
37
- use self :: TokenKind :: * ;
38
- use crate :: cursor:: EOF_CHAR ;
39
- pub use crate :: cursor:: { Cursor , FrontmatterAllowed } ;
40
-
41
40
/// Parsed token.
42
41
/// It doesn't contain information about data that has been parsed,
43
42
/// only the type of the token and its size.
@@ -372,9 +371,8 @@ pub fn is_ident(string: &str) -> bool {
372
371
impl Cursor < ' _ > {
373
372
/// Parses a token from the input string.
374
373
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 ) ;
378
376
} ;
379
377
380
378
let token_kind = match first_char {
@@ -788,7 +786,7 @@ impl Cursor<'_> {
788
786
} else {
789
787
// No base prefix, parse number in the usual way.
790
788
self . eat_decimal_digits ( ) ;
791
- } ;
789
+ }
792
790
793
791
match self . first ( ) {
794
792
// Don't be greedy if this is actually an
0 commit comments