span_contains_non_whitespace in clippy_utils - Rust
Description: Checks whether a given span has any significant token. A significant token is a non-whitespace token, including comments unless `skip_comments` is set. This is useful to determine if there are any actual code tokens in the span that are omitted in the late pass, such as platform-specific code.

Skip to main content

## span_contains_non_whitespace

# Function span_contains_non_whitespace

Source

    pub fn span_contains_non_whitespace(
        cx: &impl HasSession,
        span: Span,
        skip_comments: bool,
    ) -> bool

Expand description

Checks whether a given span has any significant token. A significant token is a non-whitespace token, including comments unless `skip_comments` is set. This is useful to determine if there are any actual code tokens in the span that are omitted in the late pass, such as platform-specific code.