Skip to content

Commit bc55379

Browse files
authored
Refactor slice content validator (#32)
1 parent ca92bec commit bc55379

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

validator_slice.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const (
1010
)
1111

1212
// Slice allows validating slice elements
13-
func Slice[T comparable, S ~[]T](s S) SliceContentValidator[T, S] {
14-
return NewSliceElemValidator(s)
13+
func Slice[T any, S ~[]T](s S) SliceContentValidator[T, S] {
14+
return NewSliceContentValidator(s)
1515
}
1616

1717
// SliceLen validates the input slice must have length in the specified range

validator_types.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ type sliceContentValidator[T any, S ~[]T] struct {
258258
elemValidatorFunc func(T, int, ItemValidator)
259259
}
260260

261-
// NewSliceElemValidator creates a new SliceContentValidator
262-
func NewSliceElemValidator[T any, S ~[]T](slice S) SliceContentValidator[T, S] {
261+
// NewSliceContentValidator creates a new SliceContentValidator
262+
func NewSliceContentValidator[T any, S ~[]T](slice S) SliceContentValidator[T, S] {
263263
return &sliceContentValidator[T, S]{slice: slice}
264264
}
265265

0 commit comments

Comments
 (0)