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

Method from_span

crates/csskit/src/commands/extract.rs:20–23  ·  view source on GitHub ↗
(span: Span, src: &str)

Source from the content-addressed store, hash-verified

18
19impl Location {
20 pub fn from_span(span: Span, src: &str) -> Self {
21 let (line, col) = span.line_and_column(src);
22 Self { line: line + 1, column: col + 1, start: usize::from(span.start()), end: usize::from(span.end()) }
23 }
24}
25
26/// A single extracted result: position + command-specific payload.

Callers

nothing calls this directly

Calls 3

line_and_columnMethod · 0.80
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected