Skip to content

Commit

Permalink
calc: minor
Browse files Browse the repository at this point in the history
  • Loading branch information
abenz1267 committed Nov 14, 2024
1 parent 23b203c commit 34b5a8f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions internal/modules/calc.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,18 @@ func (c *Calc) Setup(cfg *config.Config) bool {
func (c *Calc) SetupData(cfg *config.Config, ctx context.Context) {}

func (c Calc) Entries(ctx context.Context, term string) []util.Entry {
hasNumber := false
if c.requireNumber {
hasNumber := false

for _, c := range term {
if unicode.IsDigit(c) {
hasNumber = true
for _, c := range term {
if unicode.IsDigit(c) {
hasNumber = true
}
}
}

if !hasNumber {
return []util.Entry{}
if !hasNumber {
return []util.Entry{}
}
}

entries := []util.Entry{}
Expand Down

0 comments on commit 34b5a8f

Please sign in to comment.