-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
✅️Option<&T>
; ❌️&Option<T>
#13054
Comments
This comment was marked as duplicate.
This comment was marked as duplicate.
I've already (on the Helix PR) linked to Logan Smith's video. I didn't include it here, because I thought it was redundant |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
There is already a ref_option_ref lint that suggests this change: // bad
let x: &Option<&u32> = &Some(&0u32);
// good
let x: Option<&u32> = Some(&0u32); I guess it focuses on the internal code, whereas this issue is about fn signature, but if it is expanded to enums and other places, it might make sense to either split them into multiple lints, or rethink the whole approach? |
@rustbot claim |
If I understood correctly, you mean internal test cases for the functions that the lint depends on. Am I right? |
What it does
Title says it all, but it could be extended to
Result
and otherenum
sAdvantage
helix-editor/helix#11091
Drawbacks
If a lib has this lint, it could lead to public API breakage. However, it may be worth it, considering this lint could prevent further breakages
Example
Could be written as:
The text was updated successfully, but these errors were encountered: