mirror of https://github.com/zkat/miette.git
Implement SourceCode for Vec<u8>
This commit is contained in:
parent
3e25fd5b86
commit
775def6541
|
|
@ -119,6 +119,17 @@ impl<'src> SourceCode for &'src [u8] {
|
|||
}
|
||||
}
|
||||
|
||||
impl SourceCode for Vec<u8> {
|
||||
fn read_span<'a>(
|
||||
&'a self,
|
||||
span: &SourceSpan,
|
||||
context_lines_before: usize,
|
||||
context_lines_after: usize,
|
||||
) -> Result<Box<dyn SpanContents<'a> + 'a>, MietteError> {
|
||||
<[u8] as SourceCode>::read_span(self, span, context_lines_before, context_lines_after)
|
||||
}
|
||||
}
|
||||
|
||||
impl SourceCode for str {
|
||||
fn read_span<'a>(
|
||||
&'a self,
|
||||
|
|
|
|||
Loading…
Reference in New Issue