We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Token::is_op
1 parent bbb53bf commit 40e4827Copy full SHA for 40e4827
1 file changed
compiler/rustc_ast/src/token.rs
@@ -345,17 +345,14 @@ impl Token {
345
}
346
347
pub fn is_op(&self) -> bool {
348
- !matches!(
349
- self.kind,
350
- OpenDelim(..)
351
- | CloseDelim(..)
352
- | Literal(..)
353
- | DocComment(..)
354
- | Ident(..)
355
- | Lifetime(..)
356
- | Interpolated(..)
357
- | Eof
358
- )
+ match self.kind {
+ Eq | Lt | Le | EqEq | Ne | Ge | Gt | AndAnd | OrOr | Not | Tilde | BinOp(_)
+ | BinOpEq(_) | At | Dot | DotDot | DotDotDot | DotDotEq | Comma | Semi | Colon
+ | ModSep | RArrow | LArrow | FatArrow | Pound | Dollar | Question | SingleQuote => true,
+
+ OpenDelim(..) | CloseDelim(..) | Literal(..) | DocComment(..) | Ident(..)
+ | Lifetime(..) | Interpolated(..) | Eof => false,
+ }
359
360
361
pub fn is_like_plus(&self) -> bool {
0 commit comments