-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
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
Mark Result::{ok,err} as #[must_use] #66116
Comments
Personally I think until we come up with a proper pattern for "ignoring" must_use values and document that we shouldn't change things here. I've personally not found a solution -- |
How is it "accepted"? What's the logic behind having it such style? How widely used it is? I personally think |
I'm not saying that there should be a method, but I have definitely heard and probably read that To be clear I'm not really opposed to this marking, I just am uncertain we should do it, as these methods are sometimes used in a way where the return type isn't "must use." Maybe that doesn't make much sense :) |
I've used
|
I'm a big fan of fn ignore(self) {} which is reminds me of I think between an |
In a discussion in our Rust group, someone incorrectly uses
ok()
without checking its return value, causing confusing issue. AsResult::{is_ok, is_err}
are already marked#[must_use]
in #59610, I don't see any reasonResult::{ok, err}
shouldn't be.cc #48926
The text was updated successfully, but these errors were encountered: