Revision control

Copy as Markdown

error[E0308]: mismatched types
--> returns_not_result.rs:39:2
|
39 | #[handle_error(Error)]
| ^^^^^^^^^^^^^^^^^^^^^^ expected `String`, found `Result<String, ExternalError>`
40 | fn func() -> String {
| ------ expected `String` because of return type
|
= note: expected struct `String`
found enum `Result<String, ExternalError>`
= note: this error originates in the attribute macro `handle_error` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider using `Result::expect` to unwrap the `Result<String, ExternalError>` value, panicking if the value is a `Result::Err`
|
39 | #[handle_error(Error)].expect("REASON")
| +++++++++++++++++