(vec: Vec<&str>)
| 15 | impl error::Error for EmptyVec {} |
| 16 | |
| 17 | fn double_first(vec: Vec<&str>) -> Result<i32> { |
| 18 | let first = vec.first().ok_or(EmptyVec)?; |
| 19 | let parsed = first.parse::<i32>()?; |
| 20 | Ok(2 * parsed) |
| 21 | } |
| 22 | |
| 23 | fn print(result: Result<i32>) { |
| 24 | match result { |