Skip to content

Commit

Permalink
Fix README
Browse files Browse the repository at this point in the history
  • Loading branch information
stephencelis committed Aug 25, 2018
1 parent fdc56fc commit 6171236
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ struct User {
let name: String
}

func validate(id: Int) -> Int throws {
func validate(id: Int) throws -> Int {
guard id > 0 else {
throw Invalid.error("id must be greater than zero")
}
return id
}

func validate(email: String) -> String throws {
func validate(email: String) throws -> String {
guard email.contains("@") else {
throw Invalid.error("email must be valid")
}
return email
}

func validate(name: String) -> String throws {
func validate(name: String) throws -> String {
guard !name.isEmpty else {
throw Invalid.error("name can't be blank")
}
Expand Down

0 comments on commit 6171236

Please sign in to comment.