MCPcopy Create free account
hub / github.com/csskit/csskit / to_span

Method to_span

crates/css_ast/src/selector/nth.rs:185–200  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

183
184impl ToSpan for Nth {
185 fn to_span(&self) -> Span {
186 match self {
187 Nth::Odd(c) => c.to_span(),
188 Nth::Even(c) => c.to_span(),
189 Nth::Integer(c) => c.to_span(),
190 Nth::Anb(_, _, cursors) => {
191 let mut span = Span::ZERO;
192 for c in cursors {
193 if *c != Cursor::EMPTY {
194 span = span + (*c).into()
195 }
196 }
197 span
198 }
199 }
200 }
201}
202
203#[cfg(test)]

Callers 2

visit_nodeMethod · 0.45
visit_nodeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected