From a11a3e2c59345172e95d47fa5e7203acdf1110cb Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 26 Feb 2023 17:54:14 +0300 Subject: refactor(tvix/eval): implement From 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 --- tvix/eval/src/spans.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tvix/eval') diff --git a/tvix/eval/src/spans.rs b/tvix/eval/src/spans.rs index d2a8e9badf..c0130a6654 100644 --- a/tvix/eval/src/spans.rs +++ b/tvix/eval/src/spans.rs @@ -42,6 +42,12 @@ impl LightSpan { } } +impl From 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; -- cgit 1.4.1