Skip to content

Commit 9145c88

Browse files
committed
cm: simplify []byte->string conversion
1 parent 51a6725 commit 9145c88

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cm/case.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ func CaseUnmarshaler[T ~uint8 | ~uint16 | ~uint32](cases []string) func(v *T, te
3131
if len(text) == 0 {
3232
return errEmpty
3333
}
34-
s := string(text)
35-
c, ok := m[s]
34+
c, ok := m[string(text)]
3635
if !ok {
3736
return errNoMatchingCase
3837
}

0 commit comments

Comments
 (0)