Create a new span from the given offset range. This assumes a single line and sets the columns based on the offsets. i.e., This only works out of the box for ASCII, which is fine for most tests.
(range: Range<usize>)
| 2341 | /// line and sets the columns based on the offsets. i.e., This only works |
| 2342 | /// out of the box for ASCII, which is fine for most tests. |
| 2343 | fn span(range: Range<usize>) -> Span { |
| 2344 | let start = Position::new(range.start, 1, range.start + 1); |
| 2345 | let end = Position::new(range.end, 1, range.end + 1); |
| 2346 | Span::new(start, end) |
| 2347 | } |
| 2348 | |
| 2349 | /// Create a new span for the corresponding byte range in the given string. |
| 2350 | fn span_range(subject: &str, range: Range<usize>) -> Span { |
no outgoing calls
no test coverage detected