mirror of https://github.com/zkat/miette.git
SourceOffset -> usize in SourceSpan
This commit is contained in:
parent
c25676cb1f
commit
998a7f2130
|
|
@ -492,10 +492,10 @@ pub struct SourceSpan {
|
||||||
|
|
||||||
impl SourceSpan {
|
impl SourceSpan {
|
||||||
/// Create a new [`SourceSpan`].
|
/// Create a new [`SourceSpan`].
|
||||||
pub fn new(start: SourceOffset, length: SourceOffset) -> Self {
|
pub fn new(start: SourceOffset, length: usize) -> Self {
|
||||||
Self {
|
Self {
|
||||||
offset: start,
|
offset: start,
|
||||||
length: length.offset(),
|
length: length,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -525,8 +525,8 @@ impl From<(ByteOffset, usize)> for SourceSpan {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<(SourceOffset, SourceOffset)> for SourceSpan {
|
impl From<(SourceOffset, usize)> for SourceSpan {
|
||||||
fn from((start, len): (SourceOffset, SourceOffset)) -> Self {
|
fn from((start, len): (SourceOffset, usize)) -> Self {
|
||||||
Self::new(start, len)
|
Self::new(start, len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -427,7 +427,7 @@ impl ForwardsTo {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
ForwardsTo {
|
ForwardsTo {
|
||||||
src: SNIPPET_TEXT.into(),
|
src: SNIPPET_TEXT.into(),
|
||||||
label: SourceSpan::new(11.into(), 6.into()),
|
label: SourceSpan::new(11.into(), 6),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue