Skip to content

Commit

Permalink
Move if-else
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Feb 20, 2024
1 parent dafbdc5 commit 2e1820c
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ pub(crate) fn native_literals(
}
Some(arg) => {
let literal_expr = if let Some(literal_expr) = arg.as_literal_expr() {
// Skip implicit concatenated strings.
if literal_expr.is_implicit_concatenated() {
return;
} else {
if !literal_expr.is_implicit_concatenated() {
literal_expr
} else {
// Skip implicit concatenated strings.
return;
}
} else if let Expr::UnaryOp(ast::ExprUnaryOp {
op: UnaryOp::UAdd | UnaryOp::USub,
Expand All @@ -217,6 +217,7 @@ pub(crate) fn native_literals(
{
literal_expr
} else {
// Only allow unary operators for numbers.
return;
}
} else {
Expand Down

0 comments on commit 2e1820c

Please sign in to comment.