GT
Size: a a a
GT
DN
DN
GT
T
A
A
A
GT
let result: f32 = a.trim().parse::<f32>()? + b.trim().parse::<f32>()?;
Ошибка: the ? operator can only be used in a function that returns Result or Option (or another type that implements std::ops::Try)
cannot use the ? operator in a function that returns ()
help: the trait std::ops::Try is not implemented for ()
note: required by std::ops::Try::from_error
GT
GT
r
?
выполняет ранний возврат ошибки. Eсли функция не возвращает Result
(или Option
), то вернуть ошибку не получится.r
let result: f32 = a.trim().parse::<f32>()? + b.trim().parse::<f32>()?;
GT
GT
РХ
GT
KK
GT