Skip to content

Commit d84558a

Browse files
fix: improve Context::add_variable Err type (#127)
1 parent 256eb52 commit d84558a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

interpreter/src/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl Context<'_> {
4545
&mut self,
4646
name: S,
4747
value: V,
48-
) -> Result<(), Box<dyn std::error::Error>>
48+
) -> Result<(), <V as TryIntoValue>::Error>
4949
where
5050
S: Into<String>,
5151
V: TryIntoValue,

interpreter/src/objects.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl<K: Into<Key>, V: Into<Value>> From<HashMap<K, V>> for Map {
136136
}
137137

138138
pub trait TryIntoValue {
139-
type Error: std::error::Error + 'static;
139+
type Error: std::error::Error + 'static + Send + Sync;
140140
fn try_into_value(self) -> Result<Value, Self::Error>;
141141
}
142142

0 commit comments

Comments
 (0)