Skip to content

Commit e24364b

Browse files
committed
Change single case match to if let
1 parent aa2071c commit e24364b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/lint/rules/spacing.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -679,13 +679,10 @@ pub type NspUnaryArgs = ZeroRange;
679679
impl NspUnaryArgs {
680680
fn is_exception(node: &UnaryExpressionContent) -> bool {
681681
// Defined keyword counts as UnaryOp for DLS, but we allow space after it
682-
match node.operation.get_token() {
683-
Some(token) => match token.kind {
684-
TokenKind::Defined => true,
685-
_ => false,
686-
},
687-
None => false,
682+
if let Some(token) = node.operation.get_token() {
683+
return token.kind == TokenKind::Defined
688684
}
685+
false
689686
}
690687

691688
pub fn from_unary_expr(node: &UnaryExpressionContent)

0 commit comments

Comments
 (0)