---
source: crates/ruff_linter/src/rules/ruff/mod.rs
---
RUF038 [*] `Literal[True, False]` can be replaced with `bool`
 --> RUF038.py:4:17
  |
4 | def func1(arg1: Literal[True, False]): 
  |                 ^^^^^^^^^^^^^^^^^^^^
5 |     ...
  |
help: Replace with `bool`
  |
3 |
  - def func1(arg1: Literal[True, False]): 
4 + def func1(arg1: bool): 
5 |     ...
  |
note: This is an unsafe fix and may change runtime behavior

RUF038 [*] `Literal[True, False]` can be replaced with `bool`
 --> RUF038.py:8:17
  |
8 | def func2(arg1: Literal[True, False, True]): 
  |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
9 |     ...
  |
help: Replace with `bool`
  |
7 |
  - def func2(arg1: Literal[True, False, True]): 
8 + def func2(arg1: bool): 
9 |     ...
  |
note: This is an unsafe fix and may change runtime behavior

RUF038 [*] `Literal[True, False]` can be replaced with `bool`
  --> RUF038.py:12:16
   |
12 | def func3() -> Literal[True, False]: 
   |                ^^^^^^^^^^^^^^^^^^^^
13 |     ...
   |
help: Replace with `bool`
   |
11 |
   - def func3() -> Literal[True, False]: 
12 + def func3() -> bool: 
13 |     ...
   |
note: This is an unsafe fix and may change runtime behavior

RUF038 [*] `Literal[True, False]` can be replaced with `bool`
  --> RUF038.py:16:17
   |
16 | def func4(arg1: Literal[True, False] | bool): 
   |                 ^^^^^^^^^^^^^^^^^^^^
17 |     ...
   |
help: Replace with `bool`
   |
15 |
   - def func4(arg1: Literal[True, False] | bool): 
16 + def func4(arg1: bool | bool): 
17 |     ...
   |
note: This is an unsafe fix and may change runtime behavior

RUF038 [*] `Literal[True, False]` can be replaced with `bool`
  --> RUF038.py:20:17
   |
20 | def func5(arg1: Literal[False, True]):
   |                 ^^^^^^^^^^^^^^^^^^^^
21 |     ...
   |
help: Replace with `bool`
   |
19 |
   - def func5(arg1: Literal[False, True]):
20 + def func5(arg1: bool):
21 |     ...
   |
note: This is an unsafe fix and may change runtime behavior

RUF038 `Literal[True, False, ...]` can be replaced with `Literal[...] | bool`
  --> RUF038.py:24:17
   |
24 | def func6(arg1: Literal[True, False, "hello", "world"]):
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 |     ...
   |
help: Replace with `Literal[...] | bool`
