refactor(tvix/eval): implement From<Span> for LightSpan
This simplifies some code down the line. Change-Id: I58dd71e796e11479f44516cf24932f8061843d23 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8139 Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz>
This commit is contained in:
parent
1f9b582239
commit
a11a3e2c59
1 changed files with 6 additions and 0 deletions
|
@ -42,6 +42,12 @@ impl LightSpan {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<Span> for LightSpan {
|
||||
fn from(span: Span) -> Self {
|
||||
LightSpan::Actual { span }
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait implemented by all types from which we can retrieve a span.
|
||||
pub trait ToSpan {
|
||||
fn span_for(&self, file: &File) -> Span;
|
||||
|
|
Loading…
Reference in a new issue