vtcode 0.123.7

A Rust-based terminal coding agent with modular architecture supporting multiple LLM providers
1
2
3
4
5
6
7
8
9
10
11
12
13
14
id: no-chars-enumerate
language: Rust
severity: hint
message: Use `.char_indices()` instead of `.chars().enumerate()` when byte offsets are needed.
note: |
  `.chars().enumerate()` yields character indices (0, 1, 2, ...), not byte
  offsets. For UTF-8 byte positions, use `.char_indices()` instead. This rule
  only applies when the code needs byte offsets; if character positions are
  intentional, suppress with `ast-grep-ignore`.
rule:
  pattern: "$A.chars().enumerate()"
fix: "$A.char_indices()"
files:
  - "**/*.rs"