aboutsummaryrefslogtreecommitdiffstats
path: root/ui.go
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2023-07-29 10:41:57 -0230
committerSam Anthony <sam@samanthony.xyz>2023-07-29 10:41:57 -0230
commit88bf9516752558207bd34c4fec73ce2632c22b2c (patch)
tree814aaa9195138aac5388bd84146b2e3dc00b7463 /ui.go
parent0e1cd2b6a328887c1a630eae0b34366a607bb1b8 (diff)
downloadpfc-88bf9516752558207bd34c4fec73ce2632c22b2c.zip
use Stack push, pop methods
Diffstat (limited to 'ui.go')
-rw-r--r--ui.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui.go b/ui.go
index 85919c4..9bf9caa 100644
--- a/ui.go
+++ b/ui.go
@@ -58,9 +58,9 @@ func (ui UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
if fn := parseFunction(ui.calc.buf); fn != nil {
fn(ui.calc.stack)
} else if con := parseConstant(ui.calc.buf); con != nil {
- ui.calc.stack = append(ui.calc.stack, *con)
+ ui.calc.stack.push(*con)
} else if f, err := strconv.ParseFloat(ui.calc.buf, 64); err == nil {
- ui.calc.stack = append(ui.calc.stack, f)
+ ui.calc.stack.push(f)
}
ui.calc.buf = ""
default: