Closed
Description
I got the following error today:
error[E0308]: mismatched types
--> src/util.rs:13:33
|
13 | fn from_str(input: &str) -> Result<Self, Self::Err> {
| -------- ^^^^^^^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found ()
| |
| this function's body doesn't return
|
= note: expected type `std::result::Result<util::Color, &'static str>`
found type `()`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
I think the note this function's body doesn't return
is misleading - I thought that the issue was that an inner method I was calling had an infinite loop, or returned !
some other way, but it doesn't mean this, it actually means "this function's body doesn't return a value". Maybe the error message could be changed?