We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fn main() { let x: Result<String, ()> = Ok("asd".to_string()); x.unwrap_or(String::new()); }
The message suggests x.unwrap_or_default() but there is no such method for Result. It exists only for Option.
x.unwrap_or_default()
Result
Option
The text was updated successfully, but these errors were encountered:
Good catch! See also rust-lang/rust#37025.
Sorry, something went wrong.
Actually: https://doc.rust-lang.org/nightly/std/result/enum.Result.html#method.unwrap_or_default
I'm closing this as it seems to be working as designed. Please reopen if you disagree.
No branches or pull requests
The message suggests
x.unwrap_or_default()
but there is no such method forResult
. It exists only forOption
.The text was updated successfully, but these errors were encountered: