summaryrefslogtreecommitdiff
path: root/src/eval/ops.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-06-12 16:43:49 +0200
committerLaurenz <laurmaedje@gmail.com>2023-06-12 16:47:46 +0200
commitd3b4d7da9a801dac3af6a3cf52eb55af83adc5f5 (patch)
tree72ab79ed75dddfb7b97ddf02ba4d19c4efc9ea5a /src/eval/ops.rs
parent378ebe5f5601f11c3f428c17bed492012feb251e (diff)
More `bail!` usage
Diffstat (limited to 'src/eval/ops.rs')
-rw-r--r--src/eval/ops.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/eval/ops.rs b/src/eval/ops.rs
index bea2ea82..0880a87e 100644
--- a/src/eval/ops.rs
+++ b/src/eval/ops.rs
@@ -6,7 +6,7 @@ use std::fmt::Debug;
use ecow::eco_format;
use super::{format_str, Regex, Value};
-use crate::diag::StrResult;
+use crate::diag::{bail, StrResult};
use crate::geom::{Axes, Axis, GenAlign, Length, Numeric, PartialStroke, Rel, Smart};
use Value::*;
@@ -219,7 +219,7 @@ pub fn mul(lhs: Value, rhs: Value) -> StrResult<Value> {
/// Compute the quotient of two values.
pub fn div(lhs: Value, rhs: Value) -> StrResult<Value> {
if is_zero(&rhs) {
- Err("cannot divide by zero")?;
+ bail!("cannot divide by zero");
}
Ok(match (lhs, rhs) {