def chain

bend-lint-rules@0.2.0.0 · performance/missed_fork.bend:403

import bend-lint-rules@0.2.0.0/performance/missed_fork.bend as MissedFork
import Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint

403# The findings about the runs of lets that follow each other from `node`, a let, after `run`: each next let is the rest
404# of block of the one before, while its call uses no binder of the run.
405def chain(node: Lint.Node, +owner: Owner, run: Run) -> List<&2, Lint.Finding>:
406  match node:
407    case Lint.Node{Lint.Destructure{q}, n, s, Con{binder, Con{value, Con{+rest, Nil{}}}}, f}:
408      chain(
409        rest,
410        owner,
411        Run.add(
412          bound(Lint.Node{Lint.Destructure{q}, n, s, [binder, value, rest], f}, owner),
413          owner,
414          run
415        )
416      )
417    case _:
418      Run.finding.end(run, owner)

Uses (9)

Used by (1)