Skip to content

Commit

Permalink
Refactor with guard and .contains
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyalIcing committed Sep 22, 2015
1 parent 52b4608 commit 86e95ea
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions LanternModel/ValueValidation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,11 @@ public enum ValidationError: ErrorType {
}

public static func validateString(string: String, identifier: String) throws -> String {
print("validateString \(string)")
let string = string.stringByTrimmingCharactersInSet(whitespaceCharacterSet)
if string.isEmpty {
throw self.StringIsEmpty(string: string, identifier: identifier).cocoaError
}

print("validateString b \(string)")

return string
}

Expand Down

0 comments on commit 86e95ea

Please sign in to comment.