---
source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs
---
SIM212 [*] Use `a if a else b` instead of `b if not a else a`
 --> SIM212.py:1:5
  |
1 | c = b if not a else a  # SIM212
  |     ^^^^^^^^^^^^^^^^^
2 |
3 | c = b + c if not a else a  # SIM212
  |
help: Replace with `a if a else b`
  |
  - c = b if not a else a  # SIM212
1 + c = a if a else b  # SIM212
2 |
  |
note: This is an unsafe fix and may change runtime behavior

SIM212 [*] Use `a if a else b + c` instead of `b + c if not a else a`
 --> SIM212.py:3:5
  |
1 | c = b if not a else a  # SIM212
2 |
3 | c = b + c if not a else a  # SIM212
  |     ^^^^^^^^^^^^^^^^^^^^^
4 |
5 | c = b if not x else a  # OK
  |
help: Replace with `a if a else b + c`
  |
2 |
  - c = b + c if not a else a  # SIM212
3 + c = a if a else b + c  # SIM212
4 |
  |
note: This is an unsafe fix and may change runtime behavior
