vtcode 0.128.4

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
15
16
17
18
id: no-redundant-closure
language: Rust
severity: hint
message: Closure just forwards its argument; use a function pointer or method reference.
note: |
  `|x| foo(x)` is equivalent to `foo` when the closure does nothing but call
  a single function with its argument unchanged. Replacing the closure with
  a function reference avoids an extra layer of indirection and is more
  readable. This rule only matches single-argument closures that directly
  call a function. Closures with multiple arguments, argument reordering,
  partial application, or additional logic are not flagged.
rule:
  pattern: "|$A| $FUNC($A)"
constraints:
  FUNC:
    kind: identifier
files:
  - "**/*.rs"