1
Fork 0

coverage: Restrict empty-span expansion to only cover { and }

This commit is contained in:
Zalathar 2024-11-05 21:59:10 +11:00
parent 996bdabc2a
commit 3c30fe3423
50 changed files with 200 additions and 189 deletions

View file

@ -534,7 +534,7 @@ impl SourceMap {
/// Extracts the source surrounding the given `Span` using the `extract_source` function. The
/// extract function takes three arguments: a string slice containing the source, an index in
/// the slice for the beginning of the span and an index in the slice for the end of the span.
fn span_to_source<F, T>(&self, sp: Span, extract_source: F) -> Result<T, SpanSnippetError>
pub fn span_to_source<F, T>(&self, sp: Span, extract_source: F) -> Result<T, SpanSnippetError>
where
F: Fn(&str, usize, usize) -> Result<T, SpanSnippetError>,
{