File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -229,7 +229,7 @@ impl Token {
229
229
Token :: Word ( Word {
230
230
value : word. to_string ( ) ,
231
231
quote_style,
232
- keyword : if quote_style == None {
232
+ keyword : if quote_style. is_none ( ) {
233
233
let keyword = ALL_KEYWORDS . binary_search ( & word_uppercase. as_str ( ) ) ;
234
234
keyword. map_or ( Keyword :: NoKeyword , |x| ALL_KEYWORDS_INDEX [ x] )
235
235
} else {
@@ -354,11 +354,11 @@ impl<'a> Tokenizer<'a> {
354
354
}
355
355
356
356
Token :: Whitespace ( Whitespace :: Tab ) => self . col += 4 ,
357
- Token :: Word ( w) if w . quote_style == None => {
358
- self . col += w. value . chars ( ) . count ( ) as u64
359
- }
360
- Token :: Word ( w ) if w . quote_style != None => {
361
- self . col += w . value . chars ( ) . count ( ) as u64 + 2
357
+ Token :: Word ( w) => {
358
+ self . col += w. value . chars ( ) . count ( ) as u64 ;
359
+ if w . quote_style . is_some ( ) {
360
+ self . col += 2
361
+ }
362
362
}
363
363
Token :: Number ( s, _) => self . col += s. chars ( ) . count ( ) as u64 ,
364
364
Token :: SingleQuotedString ( s) => self . col += s. chars ( ) . count ( ) as u64 ,
You can’t perform that action at this time.
0 commit comments