---
source: crates/ruff_linter/src/rules/refurb/mod.rs
---
FURB110 [*] Replace ternary `if` expression with `or` operator
 --> FURB110.py:1:5
  |
1 | z = x if x else y  # FURB110
  |     ^^^^^^^^^^^^^
2 |
3 | z = x \
  |
help: Replace with `or` operator
  |
  - z = x if x else y  # FURB110
1 + z = x or y  # FURB110
2 |
  |

FURB110 [*] Replace ternary `if` expression with `or` operator
 --> FURB110.py:3:5
  |
1 |   z = x if x else y  # FURB110
2 |
3 |   z = x \
  |  _____^
4 | |     if x else y  # FURB110
  | |_______________^
5 |
6 |   z = x if x \
  |
help: Replace with `or` operator
  |
2 |
  - z = x \
  -     if x else y  # FURB110
3 + z = x or y  # FURB110
4 |
  |

FURB110 [*] Replace ternary `if` expression with `or` operator
  --> FURB110.py:6:5
   |
 4 |       if x else y  # FURB110
 5 |
 6 |   z = x if x \
   |  _____^
 7 | |     else  \
 8 | |         y  # FURB110
   | |_________^
 9 |
10 |   z = x() if x() else y()  # FURB110
   |
help: Replace with `or` operator
  |
5 |
  - z = x if x \
  -     else  \
  -         y  # FURB110
6 + z = x or y  # FURB110
7 |
  |

FURB110 [*] Replace ternary `if` expression with `or` operator
  --> FURB110.py:10:5
   |
 8 |         y  # FURB110
 9 |
10 | z = x() if x() else y()  # FURB110
   |     ^^^^^^^^^^^^^^^^^^^
11 |
12 | # FURB110
   |
help: Replace with `or` operator
   |
9  |
   - z = x() if x() else y()  # FURB110
10 + z = x() or y()  # FURB110
11 |
   |
note: This is an unsafe fix and may change runtime behavior

FURB110 [*] Replace ternary `if` expression with `or` operator
  --> FURB110.py:13:5
   |
12 |   # FURB110
13 |   z = x if (
   |  _____^
14 | |     # Test for x.
15 | |     x
16 | | ) else (
17 | |     # Test for y.
18 | |     y
19 | | )
   | |_^
20 |
21 |   # FURB110
   |
help: Replace with `or` operator
   |
12 | # FURB110
   - z = x if (
13 + z = (
14 |     # Test for x.
15 |     x
   - ) else (
16 + ) or (
17 |     # Test for y.
   |
note: This is an unsafe fix and may change runtime behavior

FURB110 [*] Replace ternary `if` expression with `or` operator
  --> FURB110.py:23:5
   |
21 |   # FURB110
22 |   z = (
23 | /     x if (
24 | |         # Test for x.
25 | |         x
26 | |     ) else (
27 | |         # Test for y.
28 | |         y
29 | |     )
   | |_____^
30 |   )
   |
help: Replace with `or` operator
   |
22 | z = (
   -     x if (
23 +     (
24 |         # Test for x.
25 |         x
   -     ) else (
26 +     ) or (
27 |         # Test for y.
   |
note: This is an unsafe fix and may change runtime behavior

FURB110 [*] Replace ternary `if` expression with `or` operator
  --> FURB110.py:34:5
   |
32 |   # FURB110
33 |   z = (
34 | /     x if
35 | |     # If true, use x.
36 | |     x
37 | |     # Otherwise, use y.
38 | |     else
39 | |     y
   | |_____^
40 |   )
   |
help: Replace with `or` operator
   |
33 | z = (
   -     x if
   -     # If true, use x.
   -     x
   -     # Otherwise, use y.
   -     else
   -     y
34 +     x or y
35 | )
   |
note: This is an unsafe fix and may change runtime behavior

FURB110 [*] Replace ternary `if` expression with `or` operator
  --> FURB110.py:44:5
   |
42 |   # FURB110
43 |   z = (
44 | /     x
45 | |     if x
46 | |     else y
47 | |     if y > 0
48 | |     else None
   | |_____________^
49 |   )
   |
help: Replace with `or` operator
   |
43 | z = (
   -     x
   -     if x
   -     else y
44 +     x or (y
45 |     if y > 0
   -     else None
46 +     else None)
47 | )
   |

FURB110 [*] Replace ternary `if` expression with `or` operator
  --> FURB110.py:53:5
   |
52 |   z = (
53 | /     x
54 | |     if x
55 | |     # text
56 | |     else y
   | |__________^
57 |   )
   |
help: Replace with `or` operator
   |
52 | z = (
   -     x
   -     if x
   -     # text
   -     else y
53 +     x or y
54 | )
   |
note: This is an unsafe fix and may change runtime behavior
