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
  a8606bf3_fb98_6dbb_596c_00eaf627bb81["drop_covered_spans()"]
  0fcd0fda_f6d1_052f_9575_133f5b2763a7["mod.rs"]
  a8606bf3_fb98_6dbb_596c_00eaf627bb81 -->|defined in| 0fcd0fda_f6d1_052f_9575_133f5b2763a7
  2e1301fe_658a_5bf1_3e5d_7a64079b8218["extract()"]
  2e1301fe_658a_5bf1_3e5d_7a64079b8218 -->|calls| a8606bf3_fb98_6dbb_596c_00eaf627bb81
  style a8606bf3_fb98_6dbb_596c_00eaf627bb81 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, defined in crates/oxide/src/extractor/mod.rs.
Where is drop_covered_spans() defined?
drop_covered_spans() is defined in crates/oxide/src/extractor/mod.rs at line 213.
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