diff --git a/Source/Rules/MaximumLengthRule.swift b/Source/Rules/MaximumLengthRule.swift index 0accb33..310bf8d 100644 --- a/Source/Rules/MaximumLengthRule.swift +++ b/Source/Rules/MaximumLengthRule.swift @@ -16,6 +16,6 @@ public struct MaximumLengthRule: Rule { public func validate(_ value: T) -> Bool { guard let value = value as? String else { return false } - return value.characters.count <= Int(length) + return value.characters.count <= Int(self.length) } } diff --git a/Source/Rules/MinimumLengthRule.swift b/Source/Rules/MinimumLengthRule.swift index 1598564..bf3dce0 100644 --- a/Source/Rules/MinimumLengthRule.swift +++ b/Source/Rules/MinimumLengthRule.swift @@ -16,6 +16,6 @@ public struct MinimumLengthRule: Rule { public func validate(_ value: T) -> Bool { guard let value = value as? String else { return false } - return value.characters.count >= Int(length) + return value.characters.count >= Int(self.length) } }