diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-27 00:49:02 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-27 01:00:57 +0100 |
| commit | 7caf98fe42797eab59a39ef71071030c9790245a (patch) | |
| tree | cadf45a53aad29f11bf30a164f646b5a73bb5f16 /src/model/ops.rs | |
| parent | 6bafc6391061d4b589dea835705a08b25a4df9f8 (diff) | |
Switch `StrResult` to `EcoString`
Diffstat (limited to 'src/model/ops.rs')
| -rw-r--r-- | src/model/ops.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/model/ops.rs b/src/model/ops.rs index 9a731d65..60b1c449 100644 --- a/src/model/ops.rs +++ b/src/model/ops.rs @@ -3,13 +3,14 @@ use super::{Regex, Smart, Value}; use crate::diag::StrResult; use crate::geom::{Axes, Axis, GenAlign, Length, Numeric, PartialStroke, Rel}; +use crate::util::format_eco; use std::cmp::Ordering; use Value::*; /// Bail with a type mismatch error. macro_rules! mismatch { ($fmt:expr, $($value:expr),* $(,)?) => { - return Err(format!($fmt, $($value.type_name()),*)) + return Err(format_eco!($fmt, $($value.type_name()),*)) }; } @@ -104,7 +105,7 @@ pub fn add(lhs: Value, rhs: Value) -> StrResult<Value> { (a.downcast::<GenAlign>(), b.downcast::<GenAlign>()) { if a.axis() == b.axis() { - return Err(format!("cannot add two {:?} alignments", a.axis())); + return Err(format_eco!("cannot add two {:?} alignments", a.axis())); } return Ok(Value::dynamic(match a.axis() { |
