diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-05-27 16:37:03 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-05-27 16:37:03 +0200 |
| commit | 8ba11b0722599892499337b3272cec38945d11de (patch) | |
| tree | c120a2449aaf325cb675ea3363ee69758a734d86 /src/model | |
| parent | f8009b5b59660b8252bd3ee2cedfd234a1c30cb1 (diff) | |
Reword
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/locate.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/model/locate.rs b/src/model/locate.rs index c61facc5..97c14034 100644 --- a/src/model/locate.rs +++ b/src/model/locate.rs @@ -85,7 +85,7 @@ struct SingleNode(Spanned<Func>); impl SingleNode { fn realize(&self, ctx: &mut Context) -> TypResult<Content> { let idx = ctx.pins.cursor(); - let pin = ctx.pins.next(None, None); + let pin = ctx.pins.get_or_create(None, None); let dict = pin.encode(None); let args = Args::new(self.0.span, [Value::Dict(dict)]); Ok(Content::Pin(idx) + self.0.v.call_detached(ctx, args)?.display()) @@ -106,7 +106,7 @@ struct EntryNode { impl EntryNode { fn realize(&self, ctx: &mut Context) -> TypResult<Content> { let idx = ctx.pins.cursor(); - let pin = ctx.pins.next(Some(self.group.clone()), self.value.clone()); + let pin = ctx.pins.get_or_create(Some(self.group.clone()), self.value.clone()); // Determine the index among the peers. let index = ctx @@ -231,8 +231,8 @@ impl PinBoard { self.list.len() - self.list.iter().zip(&prev.list).filter(|(a, b)| a == b).count() } - /// Access the next pin. - fn next(&mut self, group: Option<Group>, value: Option<Value>) -> Pin { + /// Access or create the next pin. + fn get_or_create(&mut self, group: Option<Group>, value: Option<Value>) -> Pin { if self.frozen() { return Pin::default(); } |
