summaryrefslogtreecommitdiff
path: root/src/eval/str.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval/str.rs')
-rw-r--r--src/eval/str.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/eval/str.rs b/src/eval/str.rs
index e3e83f3a..f5e5ab00 100644
--- a/src/eval/str.rs
+++ b/src/eval/str.rs
@@ -7,7 +7,7 @@ use ecow::EcoString;
use unicode_segmentation::UnicodeSegmentation;
use super::{cast, dict, Args, Array, Dict, Func, IntoValue, Value, Vm};
-use crate::diag::{At, SourceResult, StrResult};
+use crate::diag::{bail, At, SourceResult, StrResult};
use crate::geom::GenAlign;
/// Create a new [`Str`] from a format string.
@@ -507,7 +507,7 @@ cast! {
let mut chars = string.chars();
match (chars.next(), chars.next()) {
(Some(c), None) => c,
- _ => Err("expected exactly one character")?,
+ _ => bail!("expected exactly one character"),
}
},
}
@@ -600,7 +600,7 @@ cast! {
align: GenAlign => match align {
GenAlign::Start => Self::Start,
GenAlign::End => Self::End,
- _ => Err("expected either `start` or `end`")?,
+ _ => bail!("expected either `start` or `end`"),
},
}