Comment on Don't unwrap options: There are better ways (2024)Comments−sophacles1yMy main gripe with this error message is that it doesn’t explain why the ? operator doesn’t work with Option in that case… just that it doesn’t.The error in question:the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result`It literally tells you why it doesn't work, wtf do you want?−eviks1yIndeed, and it even suggests the 2nd solution. All you have to do is read from the top, not the bottom, of the error message−mre1yFair point. Your wording was a bit strong, but I assume you meant well. I will update the article.
Comments
The error in question:
It literally tells you why it doesn't work, wtf do you want?
Indeed, and it even suggests the 2nd solution. All you have to do is read from the top, not the bottom, of the error message
Fair point. Your wording was a bit strong, but I assume you meant well. I will update the article.