| 3 | |
| 4 | #[derive(Error, Debug)] |
| 5 | enum DoubleError { |
| 6 | #[error("no first item")] |
| 7 | EmptyVec, |
| 8 | #[error("invalid first item, error: '{0}'")] |
| 9 | Parse(#[from] std::num::ParseIntError), |
| 10 | } |
| 11 | |
| 12 | fn double_first(vec: Vec<&str>) -> Result<i32> { |
| 13 | let first = vec.first().ok_or(DoubleError::EmptyVec)?; |
nothing calls this directly
no outgoing calls
no test coverage detected