Consider the following code:
fn foo(x: i32) -> Result<i32, Error> {
//...
}
fn bar(x: Result<i32,Error>) -> Result<i32, Error> {
//...
}
fn main() {
let y = bar(foo(2)).unwrap();
}
Is this idiomatic, to pass the Result type around? Or should you handle the error or unwrap the result of bar() before passing the i32 directly.