Skip to content

Commit bd92d68

Browse files
dtarassenkojvsqzj
authored andcommitted
Change single case match to if let
1 parent 0fbba3e commit bd92d68

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
@@ -685,13 +685,10 @@ pub type NspUnaryArgs = ZeroRange;
685685
impl NspUnaryArgs {
686686
fn is_exception(node: &UnaryExpressionContent) -> bool {
687687
// Defined keyword counts as UnaryOp for DLS, but we allow space after it
688-
match node.operation.get_token() {
689-
Some(token) => match token.kind {
690-
TokenKind::Defined => true,
691-
_ => false,
692-
},
693-
None => false,
688+
if let Some(token) = node.operation.get_token() {
689+
return token.kind == TokenKind::Defined
694690
}
691+
false
695692
}
696693

697694
pub fn from_unary_expr(node: &UnaryExpressionContent)

0 commit comments

Comments
 (0)