Skip to main content

## format_lazy_static

# Function format_lazy_static

Source

    fn format_lazy_static(
        context: &RewriteContext<'_>,
        shape: Shape,
        ts: TokenStream,
        span: Span,
        macro_name: &str,
    ) -> Result<String, RewriteError>

Expand description

Format `lazy_static!` and `lazy_static::lazy_static!` from https://crates.io/crates/lazy_static.

## §Expected syntax

    lazy_static! {
        [pub] static ref NAME_1: TYPE_1 = EXPR_1;
        [pub] static ref NAME_2: TYPE_2 = EXPR_2;
        ...
        [pub] static ref NAME_N: TYPE_N = EXPR_N;
    }

    lazy_static::lazy_static! {
        [pub] static ref NAME_1: TYPE_1 = EXPR_1;
        [pub] static ref NAME_2: TYPE_2 = EXPR_2;
        ...
        [pub] static ref NAME_N: TYPE_N = EXPR_N;
    }