diff options
| author | Martin Haug <mhaug@live.de> | 2022-05-27 16:39:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-27 16:39:06 +0200 |
| commit | 73086b5a7c1b0f9f638165803c237901499adb64 (patch) | |
| tree | c120a2449aaf325cb675ea3363ee69758a734d86 /src/eval/func.rs | |
| parent | 99cb655832161d4ebec73273a15453a8f6acc1b7 (diff) | |
| parent | 8ba11b0722599892499337b3272cec38945d11de (diff) | |
Merge pull request #71 from typst/pins
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 f15549dc..12dbfb2e 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.def_mut(param, match default { + scopes.top.define(param, 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.def_mut(sink, args.take()); + scopes.top.define(sink, args.take()); } // Determine the route inside the closure. |
