---
source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs
---
C418 [*] Unnecessary dict literal passed to `dict()` (remove the outer call to `dict()`)
 --> C418.py:1:1
  |
1 | dict({})
  | ^^^^^^^^
2 | dict({'a': 1})
3 | dict({'x': 1 for x in range(10)})
  |
help: Remove outer `dict()` call
  |
  - dict({})
1 + {}
2 | dict({'a': 1})
  |
note: This is an unsafe fix and may change runtime behavior

C418 [*] Unnecessary dict literal passed to `dict()` (remove the outer call to `dict()`)
 --> C418.py:2:1
  |
1 | dict({})
2 | dict({'a': 1})
  | ^^^^^^^^^^^^^^
3 | dict({'x': 1 for x in range(10)})
4 | dict(
  |
help: Remove outer `dict()` call
  |
1 | dict({})
  - dict({'a': 1})
2 + {'a': 1}
3 | dict({'x': 1 for x in range(10)})
  |
note: This is an unsafe fix and may change runtime behavior

C418 [*] Unnecessary dict comprehension passed to `dict()` (remove the outer call to `dict()`)
 --> C418.py:3:1
  |
1 | dict({})
2 | dict({'a': 1})
3 | dict({'x': 1 for x in range(10)})
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 | dict(
5 |     {'x': 1 for x in range(10)}
  |
help: Remove outer `dict()` call
  |
2 | dict({'a': 1})
  - dict({'x': 1 for x in range(10)})
3 + {'x': 1 for x in range(10)}
4 | dict(
  |
note: This is an unsafe fix and may change runtime behavior

C418 [*] Unnecessary dict comprehension passed to `dict()` (remove the outer call to `dict()`)
 --> C418.py:4:1
  |
2 |   dict({'a': 1})
3 |   dict({'x': 1 for x in range(10)})
4 | / dict(
5 | |     {'x': 1 for x in range(10)}
6 | | )
  | |_^
7 |
8 |   dict({}, a=1)
  |
help: Remove outer `dict()` call
  |
3 | dict({'x': 1 for x in range(10)})
  - dict(
  -     {'x': 1 for x in range(10)}
  - )
4 + {'x': 1 for x in range(10)}
5 |
  |
note: This is an unsafe fix and may change runtime behavior
