Error handling in Rust: a k-NN case study

from blog Huon on the internet, | ↗ original
After posting a Rust translation of some k-nearest neighbour code, I got a few comments asking “how would you handle errors if you wanted to?”. This is the perfect chance to briefly demonstrate a few idioms. See my previous post for context and the original code; like with the code in that post, this code compiles with rustc 0.11.0-pre-nightly...