We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dafbdc5 commit 7d309e7Copy full SHA for 7d309e7
crates/ruff_linter/src/rules/pyupgrade/rules/native_literals.rs
@@ -202,9 +202,8 @@ pub(crate) fn native_literals(
202
// Skip implicit concatenated strings.
203
if literal_expr.is_implicit_concatenated() {
204
return;
205
- } else {
206
- literal_expr
207
}
+ literal_expr
208
} else if let Expr::UnaryOp(ast::ExprUnaryOp {
209
op: UnaryOp::UAdd | UnaryOp::USub,
210
operand,
@@ -217,6 +216,7 @@ pub(crate) fn native_literals(
217
216
{
218
literal_expr
219
} else {
+ // Only allow unary operators for numbers.
220
221
222
0 commit comments