Made Validation protocol extension properties public

This commit is contained in:
Caleb Kleveter 2019-01-17 12:17:53 -06:00
parent ce7a9362ed
commit dc5a6f872a
No known key found for this signature in database
GPG Key ID: B38DBD5CF2C98D69
2 changed files with 4 additions and 4 deletions

View File

@ -21,10 +21,10 @@ public protocol LengthValidation: Validation where Supported: Collection {
}
extension LengthValidation {
static var minLength: Int { return 0 }
public static var minLength: Int { return 0 }
/// See `Validation.validate(_:)`.
static func validate(_ value: Supported)throws {
public static func validate(_ value: Supported)throws {
guard value.count <= self.maxLength else {
throw ValidationError(identifier: "lengthTooLong", reason: "Length of collection value is greater than \(self.maxLength)")
}

View File

@ -24,8 +24,8 @@ public protocol InRangeValidation: Validation where Supported: Comparable {
}
extension InRangeValidation {
static var max: Supported? { return nil }
static var min: Supported? { return nil }
public static var max: Supported? { return nil }
public static var min: Supported? { return nil }
/// See `Validation.validate(_:)`.
public static func validate(_ value: Supported)throws {