diff --git a/validator_slice.go b/validator_slice.go index 08c2a5a..9513f84 100644 --- a/validator_slice.go +++ b/validator_slice.go @@ -10,8 +10,8 @@ const ( ) // Slice allows validating slice elements -func Slice[T comparable, S ~[]T](s S) SliceContentValidator[T, S] { - return NewSliceElemValidator(s) +func Slice[T any, S ~[]T](s S) SliceContentValidator[T, S] { + return NewSliceContentValidator(s) } // SliceLen validates the input slice must have length in the specified range diff --git a/validator_types.go b/validator_types.go index a90f6dc..815587d 100644 --- a/validator_types.go +++ b/validator_types.go @@ -258,8 +258,8 @@ type sliceContentValidator[T any, S ~[]T] struct { elemValidatorFunc func(T, int, ItemValidator) } -// NewSliceElemValidator creates a new SliceContentValidator -func NewSliceElemValidator[T any, S ~[]T](slice S) SliceContentValidator[T, S] { +// NewSliceContentValidator creates a new SliceContentValidator +func NewSliceContentValidator[T any, S ~[]T](slice S) SliceContentValidator[T, S] { return &sliceContentValidator[T, S]{slice: slice} }