Skip to content

Commit

Permalink
chore(digit): update converts
Browse files Browse the repository at this point in the history
  • Loading branch information
andeya committed Sep 20, 2022
1 parent 6f4ef7d commit e4f0555
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions digit/converts.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ func TryFromStrings[T ~string, D Digit](a []T, base int, bitSize int) (b []D, er
}

// ToBool converts D to bool.
func ToBool[T ~string | Digit](v T) bool {
func ToBool[T Digit](v T) bool {
zero := new(T)
return v != *zero
}

// ToBools converts []D to []bool.
func ToBools[T ~string | Digit](a []T) []bool {
func ToBools[T Digit](a []T) []bool {
b := make([]bool, len(a))
for i, t := range a {
b[i] = ToBool(t)
Expand Down

0 comments on commit e4f0555

Please sign in to comment.