diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-06-12 16:43:49 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-06-12 16:47:46 +0200 |
| commit | d3b4d7da9a801dac3af6a3cf52eb55af83adc5f5 (patch) | |
| tree | 72ab79ed75dddfb7b97ddf02ba4d19c4efc9ea5a /src/eval/scope.rs | |
| parent | 378ebe5f5601f11c3f428c17bed492012feb251e (diff) | |
More `bail!` usage
Diffstat (limited to 'src/eval/scope.rs')
| -rw-r--r-- | src/eval/scope.rs | 4 |
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") } } } |
