Skip to content

Commit

Permalink
refactor: use existing slices contains function instead of own
Browse files Browse the repository at this point in the history
  • Loading branch information
Armin Becher authored and Armin Becher committed Jan 4, 2024
1 parent 1674803 commit 0247d9b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 31 deletions.
13 changes: 0 additions & 13 deletions internal/collection/collection.go

This file was deleted.

16 changes: 0 additions & 16 deletions internal/collection/collection_test.go

This file was deleted.

4 changes: 2 additions & 2 deletions internal/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package ui
import (
"fmt"
"log"
"slices"
"sort"
"strings"

"github.com/becheran/roumon/internal/collection"
"github.com/becheran/roumon/internal/model"
"github.com/gizak/termui/v3/widgets"

Expand Down Expand Up @@ -186,7 +186,7 @@ func (ui *UI) updateStatus() {
for idx, t := range types {
data[idx] = typeCount[t]
newLabel := t[:3]
if collection.SliceContains(labels, newLabel) {
if slices.Contains(labels, newLabel) {
newLabel = fmt.Sprintf("%s%d", t[:2], uniqueID)
uniqueID++
}
Expand Down

0 comments on commit 0247d9b

Please sign in to comment.