Rust Vec: How to return error with Result<T,E>?
Advertisements I have a function with reference input, and return: return value: if input is valid return error: if input is invalid fn get_fourth(input: &Vec<i32>) -> Result<i32, ParseIntError> { let q = match input.get(4) { Some(v) => v, _ => return Err(ParseIntError {kind: ParseIntError} ) }; Ok(*q) } ParseIntError is just temporary for my testing… Read More Rust Vec: How to return error with Result<T,E>?