-
Notifications
You must be signed in to change notification settings - Fork 121
Adoption of throws
, remove Result
dependency
#50
Conversation
6b8c6f9
to
9a47f2f
Compare
Updated to depend on #53. |
9a47f2f
to
9a651ee
Compare
9a651ee
to
0945a75
Compare
0945a75
to
b592b0b
Compare
b592b0b
to
13f7e14
Compare
Rebased to resolve all dependencies. |
Further changes have been made to subscripting to reduce complexity and remove more code.
Please give another glance over |
Updated to replace |
} | ||
|
||
let key = try! decodeString().string() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you using try!
and not just try
? If the decodeString()
throws, don't we want to propagate that error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good point. I think the change passes just happened at different times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, it might also be that I was going to change the internal functions like decodeString()
to return String
instead of JSON
. But that'll be later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one of the few things that I saw in all of this that I think is "wrong". As far as I can recall, most of the other suggestions are simply thoughts/suggestions/confusion.
If this should be changed, go ahead and make it, or I can if you're ok with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed.
throws
, remove Result
dependencythrows
, remove Result
dependency
eecddb9
to
874ea3a
Compare
Updated to address comments as well as resolve mergability with its base branch. |
…ication Adoption of `throws`, remove `Result` dependency
This is it… the big one. This completes the triumvirate of Swift 2 PRs, starting with #48 and #53.
This is a big breaking change and should be considered very carefully for completeness, clarity, and documentation coverage.
throws
on errorString
orInt
) as varargs, so instead oflet name: Result<String> = json["details"]["people"][0]["name"].string
, you getlet name: String = try json.string("details", "people", 0, "name")
.@autoclosure or: () -> T
, completing Add ability to fall-back to defaults for missing values #30 and superseding Fallback (or
) #32..Null
.throws
for deserializing, serializing, parsing, and encoding.JSONParser
a public API.TODO/Known issues: