mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 14:23:20 +02:00
replace codespan-reporting with miette 3.0
This commit is contained in:
@ -1,9 +1,17 @@
|
||||
use miette::SourceSpan;
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub struct Span {
|
||||
pub start: usize,
|
||||
pub end: usize,
|
||||
}
|
||||
|
||||
impl From<Span> for SourceSpan {
|
||||
fn from(s: Span) -> Self {
|
||||
Self::new(s.start.into(), (s.end - s.start).into())
|
||||
}
|
||||
}
|
||||
|
||||
impl Span {
|
||||
pub fn new(start: usize, end: usize) -> Span {
|
||||
Span { start, end }
|
||||
|
Reference in New Issue
Block a user