My function reads a calibration file and parses a number: let s = std::fs::read_to_string(path)?; let gain: f32 = s.trim().parse()?;. With the return type Result<f32, std::io::Error> the first ? compiles, but the second complains that From<ParseFloatError> is not implemented for std::io::Error. Using ? in main gives a different error about the return type.
What does ? expand to, and what is the normal way to handle several error types in one function without writing match everywhere?




