ruff/crates/ruff_cli
konsti aafde6db28
Remove some indexing (#6728)
**Summary** A common pattern in the code used to be
```rust
if statements.len() != 1 {
    return;
}
use_single_entry(statements[0])?;
```
which can be better expressed as
```rust
let [statement] = statements else {
    return;
};
use_single_entry(statements)?;
```

Direct indexing can cause panics if you don't manually take care of
checking the length, while matching (such as if-let or let-else) can
never panic.

This isn't a complete refactor, i've just removed some of the obvious
cases. I've specifically looked for `.len() != 1` and fixed those.

**Test Plan** No functional changes
2023-08-21 16:56:15 +02:00
..
resources/test/fixtures Include file permissions in key for cached files (#5901) 2023-07-25 17:06:47 +00:00
src Remove some indexing (#6728) 2023-08-21 16:56:15 +02:00
tests Respect .ipynb and .pyi sources when linting from stdin (#6628) 2023-08-16 20:33:59 +00:00
Cargo.toml Bump version to 0.0.285 (#6660) 2023-08-17 15:46:28 -05:00