Skip to content

Commit 7d309e7

Browse files
committed
Move if-else
1 parent dafbdc5 commit 7d309e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/ruff_linter/src/rules/pyupgrade/rules/native_literals.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,8 @@ pub(crate) fn native_literals(
202202
// Skip implicit concatenated strings.
203203
if literal_expr.is_implicit_concatenated() {
204204
return;
205-
} else {
206-
literal_expr
207205
}
206+
literal_expr
208207
} else if let Expr::UnaryOp(ast::ExprUnaryOp {
209208
op: UnaryOp::UAdd | UnaryOp::USub,
210209
operand,
@@ -217,6 +216,7 @@ pub(crate) fn native_literals(
217216
{
218217
literal_expr
219218
} else {
219+
// Only allow unary operators for numbers.
220220
return;
221221
}
222222
} else {

0 commit comments

Comments
 (0)