Skip to main content

Collect

Function Collect 

Source
pub fn Collect(Block: &Block, InlineComments: bool) -> Vec<Candidate>
Expand description

Collect all structurally eligible let bindings in Block.

Bindings are excluded when:

  • The pattern is not a plain identifier (destructuring, tuple, …).
  • The binding is let mut or let ref.
  • The binding has a @ subpat.
  • There is no initialiser (let x;).
  • There is a diverging else branch (let … = … else { … }).
  • The let statement carries attributes AND InlineComments is false.
  • The binding is the last statement in the block (nothing to substitute into).