---
source: crates/ruff_linter/src/rules/ruff/mod.rs
---
RUF015 [*] Prefer `next(*x for x in xs)` over single element slice
 --> RUF015_py315.py:3:1
  |
1 | xs = [[1], [2]]
2 |
3 | [*x for x in xs][0]
  | ^^^^^^^^^^^^^^^^^^^
4 | list(*x for x in xs)[0]
  |
help: Replace with `next(*x for x in xs)`
  |
2 |
  - [*x for x in xs][0]
3 + next(*x for x in xs)
4 | list(*x for x in xs)[0]
  |
note: This is an unsafe fix and may change runtime behavior

RUF015 [*] Prefer `next(*x for x in xs)` over single element slice
 --> RUF015_py315.py:4:1
  |
3 | [*x for x in xs][0]
4 | list(*x for x in xs)[0]
  | ^^^^^^^^^^^^^^^^^^^^^^^
  |
help: Replace with `next(*x for x in xs)`
  |
3 | [*x for x in xs][0]
  - list(*x for x in xs)[0]
4 + next(*x for x in xs)
  |
note: This is an unsafe fix and may change runtime behavior
