diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-07-26 23:24:50 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-07-26 23:27:44 +0200 |
| commit | fc574b39454aec77cf2c33270566225917c7c823 (patch) | |
| tree | ccebc217ce9f869bb0078753a7749789d77db551 /src/eval/func.rs | |
| parent | 1e9a5eda48c65096b482b396d550d139a4c2e61d (diff) | |
New `Str` type with methods
Diffstat (limited to 'src/eval/func.rs')
| -rw-r--r-- | src/eval/func.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/eval/func.rs b/src/eval/func.rs index 7ab03b6a..bd312d66 100644 --- a/src/eval/func.rs +++ b/src/eval/func.rs @@ -206,7 +206,7 @@ impl Closure { // Parse the arguments according to the parameter list. for (param, default) in &self.params { - scopes.top.define(param, match default { + scopes.top.define(param.clone(), match default { None => args.expect::<Value>(param)?, Some(default) => { args.named::<Value>(param)?.unwrap_or_else(|| default.clone()) @@ -216,7 +216,7 @@ impl Closure { // Put the remaining arguments into the sink. if let Some(sink) = &self.sink { - scopes.top.define(sink, args.take()); + scopes.top.define(sink.clone(), args.take()); } // Determine the route inside the closure. |
