News for hackers. Stuff that matters.
Re:Comparing k-NN in Rust by kzrdude on Tuesday June 10, 2014 @11:00AM (#7872878)
How much work would it be to rewrite `slurp_file` to return an `Option<..>` result, that is replace all of the .unwrap calls into some kind of short-circuit return?
Re:Comparing k-NN in Rust by dbaupp on Tuesday June 10, 2014 @07:02PM (#7875794)
Re:Comparing k-NN in Rust by kzrdude on Wednesday June 11, 2014 @06:01AM (#7877162)
Ok that's the amazingest answer you could give to my question! Very cool, it doesn't look so bad.

In my mind this style should be the default for error handling when coding (i.e. I'd prefer to push the choice of using .unwrap or not to the caller)

Re:Comparing k-NN in Rust by dbaupp on Tuesday June 10, 2014 @11:22AM (#7873022)
It shouldn't be too hard, but you may have to write the short circuiting `map` by hand with a for loop.