is_direct_expn_of in clippy_utils - Rust
Description: Returns the pre-expansion span if the span directly comes from an expansion of the macro `name`. The difference with `is_expn_of` is that in

Skip to main content

## is_direct_expn_of

# Function is_direct_expn_of

Source

    pub fn is_direct_expn_of(span: Span, name: Symbol) -> Option<Span>

Expand description

Returns the pre-expansion span if the span directly comes from an expansion of the macro `name`. The difference with `is_expn_of` is that in

    foo!(bar!(42));

`42` is considered expanded from `foo!` and `bar!` by `is_expn_of` but only from `bar!` by `is_direct_expn_of`.