summaryrefslogtreecommitdiff
path: root/src/eval/func.rs
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2022-05-27 16:39:06 +0200
committerGitHub <noreply@github.com>2022-05-27 16:39:06 +0200
commit73086b5a7c1b0f9f638165803c237901499adb64 (patch)
treec120a2449aaf325cb675ea3363ee69758a734d86 /src/eval/func.rs
parent99cb655832161d4ebec73273a15453a8f6acc1b7 (diff)
parent8ba11b0722599892499337b3272cec38945d11de (diff)
Merge pull request #71 from typst/pins
Diffstat (limited to 'src/eval/func.rs')
-rw-r--r--src/eval/func.rs4
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.