Great stuff!<p>One minor suggestion, completely beside the point so please forgive me: a safer and perhaps more idiomatic way to implement the multiply_safe function would be with a functional-style one-liner:<p><pre><code> fn multiply_safe(a : Vec<f64>, b : Vec<f64>) -> Vec<f64> {
if a.len() != b.len() {
panic!("The two vectors differ in length!");
}
return a.iter().zip(b.iter()).map(|(x, y)| x * y).collect()
}
</code></pre>
Safer because you don't manipulate indices and lengths directly like you would in C, so there is no opportunity of an off-by-one bug or things like that. Surprisingly, rustc optimizer makes sure that this performs as well as the index-wrangling implementation (according to some simple tests I just ran).