Your main
function does not return a Result
. You need to do something with the error case. Probably something like function().expect("oh no! function() failed!!");
, which will cause a panic and error exit in the unlikely event function()
fails. expect()
turns a Result<A,B>
into an A
on success, and panics displaying a combination of your error message and the B
on failure.
Or you could use Result::unwrap()
which works similarly without adding an error message of your own, just using the error value of the Result
.