if_sequence in clippy_utils - Rust
Description: Returns the list of condition expressions and the list of blocks in a sequence of `if/else`. E.g., this returns `([a, b], [c, d, e])` for the expression `if a { c } else if b { d } else { e }`.

Skip to main content

## if_sequence

# Function if_sequence

Source

    pub fn if_sequence<'tcx>(
        expr: &'tcx Expr<'tcx>,
    ) -> (Vec<&'tcx Expr<'tcx>>, Vec<&'tcx Block<'tcx>>)

Expand description

Returns the list of condition expressions and the list of blocks in a sequence of `if/else`. E.g., this returns `([a, b], [c, d, e])` for the expression `if a { c } else if b { d } else { e }`.