Skip to content

Commit

Permalink
README: Remove comment about decodeIfPresent
Browse files Browse the repository at this point in the history
It's a bit self-explanatory, given that the following line is using `try?`, and clutters up the code sample.
  • Loading branch information
JohnSundell authored May 14, 2019
1 parent b930ac1 commit 8d7c46d
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ struct Article: Codable {
title = try decoder.decode("title")
body = try decoder.decode("body")
footnotes = try decoder.decodeIfPresent("footnotes")
// Or if you prefer to ignore type errors for optional properties, you can use:
// footnotes = try? decoder.decode("footnotes")
tags = (try? decoder.decode("tags")) ?? []
}
}
Expand Down

0 comments on commit 8d7c46d

Please sign in to comment.