News for hackers. Stuff that matters.
Re:Parsing JSON is a Minefield by burntsushi on Thursday October 27, 2016 @07:20AM (#12804182)
Rust nearly has that same benefit. You can wrap `parse_json_stream(f_in)` in `try!(parse_json_stream(f_in))`, and if an error was returned from `parse_json_stream`, then an early return for `load_data` is inserted automatically, thereby propagating the error, similar to raising an exception.

Of course, these approaches are not isomorphic, but in Rust, the cost of explicitly checking an error value is typically very small thanks to algebraic data types, polymorphism and macros.

There are no comments on this comment yet.