diff options
author | Vincent Ambo <mail@tazj.in> | 2023-02-26T14·54+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2023-03-04T15·18+0000 |
commit | a11a3e2c59345172e95d47fa5e7203acdf1110cb (patch) | |
tree | 9511ebec76236c51a35f95c1839deb31c39ba59e /tvix | |
parent | 1f9b5822391fa63b83f4224ba43ed404ded6dae8 (diff) |
refactor(tvix/eval): implement From<Span> for LightSpan r/5883
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>
Diffstat (limited to 'tvix')
-rw-r--r-- | tvix/eval/src/spans.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tvix/eval/src/spans.rs b/tvix/eval/src/spans.rs index d2a8e9badf86..c0130a665428 100644 --- a/tvix/eval/src/spans.rs +++ b/tvix/eval/src/spans.rs @@ -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; |