diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-01-01 17:54:31 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-01-01 17:54:31 +0100 |
| commit | 8cad78481cd52680317032c3bb84cacda5666489 (patch) | |
| tree | 7cc0d17b2ec6d231c33205fa4765de1d63ee32ea /src/eval/value.rs | |
| parent | 2b6ccd82489afbcd679fb3199de2618fa8811325 (diff) | |
A few small improvements ♻
Diffstat (limited to 'src/eval/value.rs')
| -rw-r--r-- | src/eval/value.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/eval/value.rs b/src/eval/value.rs index f15ae0c5..a009e891 100644 --- a/src/eval/value.rs +++ b/src/eval/value.rs @@ -11,7 +11,7 @@ use crate::color::Color; use crate::diag::Diag; use crate::geom::{Dir, Length, Linear, Relative}; use crate::paper::Paper; -use crate::syntax::{Ident, SpanWith, Spanned, SynTree}; +use crate::syntax::{Ident, Spanned, SynTree, WithSpan}; /// A computational value. #[derive(Clone, PartialEq)] @@ -69,11 +69,11 @@ impl Value { } } -impl Eval for Value { +impl Eval for &Value { type Output = (); /// Evaluate everything contained in this value. - fn eval(&self, ctx: &mut EvalContext) -> Self::Output { + fn eval(self, ctx: &mut EvalContext) -> Self::Output { match self { // Don't print out none values. Value::None => {} @@ -206,7 +206,7 @@ impl<T> Conv<T> { impl<T: TryFromValue> TryFromValue for Spanned<T> { fn try_from_value(value: Spanned<Value>) -> Conv<Self> { let span = value.span; - T::try_from_value(value).map(|v| v.span_with(span)) + T::try_from_value(value).map(|v| v.with_span(span)) } } |
