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:
Vincent Ambo 2023-02-26 17:54:14 +03:00 committed by tazjin
parent 1f9b582239
commit a11a3e2c59

View file

@ -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;