# Function rustfmt_nightly::items::same_line_else_kw_and_brace

source ·

    fn same_line_else_kw_and_brace(
        init_str: &str,
        context: &RewriteContext<'_>,
        else_kw_span: Span,
        init_shape: Shape,
    ) -> bool

Expand description

When the initializer expression is multi-lined, then the else keyword and opening brace of the block ( i.e. “else {”) should be put on the same line as the end of the initializer expression if all the following are true:

1. The initializer expression ends with one or more closing parentheses, square brackets, or braces
2. There is nothing else on that line
3. That line is not indented beyond the indent on the first line of the let keyword