summaryrefslogtreecommitdiff
path: root/src/eval/scope.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval/scope.rs')
-rw-r--r--src/eval/scope.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/eval/scope.rs b/src/eval/scope.rs
index f2aa26fb..f3e13715 100644
--- a/src/eval/scope.rs
+++ b/src/eval/scope.rs
@@ -5,7 +5,7 @@ use std::hash::Hash;
use ecow::{eco_format, EcoString};
use super::{IntoValue, Library, Value};
-use crate::diag::StrResult;
+use crate::diag::{bail, StrResult};
/// A stack of scopes.
#[derive(Debug, Default, Clone)]
@@ -171,7 +171,7 @@ impl Slot {
match self.kind {
Kind::Normal => Ok(&mut self.value),
Kind::Captured => {
- Err("variables from outside the function are read-only and cannot be modified")?
+ bail!("variables from outside the function are read-only and cannot be modified")
}
}
}