Home / Function/ drop_covered_spans() — tailwindcss Function Reference

drop_covered_spans() — tailwindcss Function Reference

Architecture documentation for the drop_covered_spans() function in mod.rs from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  1420ecae_486c_5643_9c41_1d010f3fc55e["drop_covered_spans()"]
  422ad34b_4317_4855_30c2_d1ae1b67d97a["extract()"]
  422ad34b_4317_4855_30c2_d1ae1b67d97a -->|calls| 1420ecae_486c_5643_9c41_1d010f3fc55e
  style 1420ecae_486c_5643_9c41_1d010f3fc55e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

crates/oxide/src/extractor/mod.rs lines 213–231

fn drop_covered_spans(mut spans: Vec<Span>) -> Vec<Span> {
    if spans.len() <= 1 {
        return spans;
    }

    spans.sort_by(|a, b| a.start.cmp(&b.start).then(b.end.cmp(&a.end)));

    let mut result = Vec::with_capacity(spans.len());
    let mut max_end = None;

    for span in spans {
        if max_end.is_none_or(|end| span.end > end) {
            result.push(span);
            max_end = Some(span.end);
        }
    }

    result
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does drop_covered_spans() do?
drop_covered_spans() is a function in the tailwindcss codebase.
What calls drop_covered_spans()?
drop_covered_spans() is called by 1 function(s): extract.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free