---
source: crates/ruff_linter/src/rules/refurb/mod.rs
---
FURB136 [*] Replace `x if x > y else y` with `max(y, x)`
 --> FURB136.py:4:1
  |
2 | y = 2
3 |
4 | x if x > y else y  # FURB136
  | ^^^^^^^^^^^^^^^^^
5 |
6 | x if x >= y else y  # FURB136
  |
help: Replace with `max(y, x)`
  |
3 |
  - x if x > y else y  # FURB136
4 + max(y, x)  # FURB136
5 |
  |

FURB136 [*] Replace `x if x >= y else y` with `max(x, y)`
 --> FURB136.py:6:1
  |
4 | x if x > y else y  # FURB136
5 |
6 | x if x >= y else y  # FURB136
  | ^^^^^^^^^^^^^^^^^^
7 |
8 | x if x < y else y  # FURB136
  |
help: Replace with `max(x, y)`
  |
5 |
  - x if x >= y else y  # FURB136
6 + max(x, y)  # FURB136
7 |
  |

FURB136 [*] Replace `x if x < y else y` with `min(y, x)`
  --> FURB136.py:8:1
   |
 6 | x if x >= y else y  # FURB136
 7 |
 8 | x if x < y else y  # FURB136
   | ^^^^^^^^^^^^^^^^^
 9 |
10 | x if x <= y else y  # FURB136
   |
help: Replace with `min(y, x)`
  |
7 |
  - x if x < y else y  # FURB136
8 + min(y, x)  # FURB136
9 |
  |

FURB136 [*] Replace `x if x <= y else y` with `min(x, y)`
  --> FURB136.py:10:1
   |
 8 | x if x < y else y  # FURB136
 9 |
10 | x if x <= y else y  # FURB136
   | ^^^^^^^^^^^^^^^^^^
11 |
12 | y if x > y else x  # FURB136
   |
help: Replace with `min(x, y)`
   |
9  |
   - x if x <= y else y  # FURB136
10 + min(x, y)  # FURB136
11 |
   |

FURB136 [*] Replace `y if x > y else x` with `min(x, y)`
  --> FURB136.py:12:1
   |
10 | x if x <= y else y  # FURB136
11 |
12 | y if x > y else x  # FURB136
   | ^^^^^^^^^^^^^^^^^
13 |
14 | y if x >= y else x  # FURB136
   |
help: Replace with `min(x, y)`
   |
11 |
   - y if x > y else x  # FURB136
12 + min(x, y)  # FURB136
13 |
   |

FURB136 [*] Replace `y if x >= y else x` with `min(y, x)`
  --> FURB136.py:14:1
   |
12 | y if x > y else x  # FURB136
13 |
14 | y if x >= y else x  # FURB136
   | ^^^^^^^^^^^^^^^^^^
15 |
16 | y if x < y else x  # FURB136
   |
help: Replace with `min(y, x)`
   |
13 |
   - y if x >= y else x  # FURB136
14 + min(y, x)  # FURB136
15 |
   |

FURB136 [*] Replace `y if x < y else x` with `max(x, y)`
  --> FURB136.py:16:1
   |
14 | y if x >= y else x  # FURB136
15 |
16 | y if x < y else x  # FURB136
   | ^^^^^^^^^^^^^^^^^
17 |
18 | y if x <= y else x  # FURB136
   |
help: Replace with `max(x, y)`
   |
15 |
   - y if x < y else x  # FURB136
16 + max(x, y)  # FURB136
17 |
   |

FURB136 [*] Replace `y if x <= y else x` with `max(y, x)`
  --> FURB136.py:18:1
   |
16 | y if x < y else x  # FURB136
17 |
18 | y if x <= y else x  # FURB136
   | ^^^^^^^^^^^^^^^^^^
19 |
20 | x + y if x > y else y  # OK
   |
help: Replace with `max(y, x)`
   |
17 |
   - y if x <= y else x  # FURB136
18 + max(y, x)  # FURB136
19 |
   |

FURB136 [*] Replace `if` expression with `max(y, x)`
  --> FURB136.py:22:1
   |
20 |   x + y if x > y else y  # OK
21 |
22 | / x if (
23 | |     x
24 | |     > y
25 | | ) else y  # FURB136
   | |________^
   |
help: Replace with `max(y, x)`
   |
21 |
   - x if (
   -     x
   -     > y
   - ) else y  # FURB136
22 + max(y, x)  # FURB136
23 |
   |

FURB136 [*] Replace `if` expression with `max(y, x)`
  --> FURB136.py:29:5
   |
28 |   highest_score = (
29 | /     x
30 | |     # text
31 | |     if x > y
32 | |     else y
   | |__________^
33 |   )
   |
help: Replace with `max(y, x)`
   |
28 | highest_score = (
   -     x
   -     # text
   -     if x > y
   -     else y
29 +     max(y, x)
30 | )
   |
note: This is an unsafe fix and may change runtime behavior
