|I learned a great deal about error handling in Rust as a result, however. So I consider it a win. Here is my final commit message of the day:|
fix(2019/1): avoid unwrap
unwrap() panics on error, which is not my intention.
Rather, I wish to return a generic error result.
I use the std::error:Error trait as a boxed type here,
based on a thorough review of my error handling options.
The following information was helpful in identifying which
options are and are not viable for error handling in Rust:
I am disappointed that I must forgo the functional paradigm
in order to properly bubble errors up to the caller.
Ignoring read/parse errors while summing lines is incorrect,
in this case.
If omitting IO errors and malformed lines is acceptable,
a functional style can be achieved with filter_map().