-
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
De-unwrap
all assists
#15398
Comments
The |
That's right, but we could still extract that into a local variable and check it properly. It's not worse, and we won't spend time figuring it out again the next 10 times we go through the assists. EDIT: even a single |
A comment would suffice I'd say. It's definitely bad to Meanwhile, I've found that |
I mean, a |
By the way, my idea here is to clean up as much of these as we can, then add a "ratchet"-style test to make sure we're not adding more by mistake. |
Don't provide `generate_default_from_new` when impl self ty is missing Also don't provide the assist when the `Default` trait can't be found. Part of #15398
minor: Remove `unwrap` from `Remove dbg!` Part of #15398.
…icola minor : Deunwrap remove_unused_imports #15398 Subtask 3
…r=Veykril minor : Deunwrap convert_to_guarded_return Closes subtask 12 of #15398
…r=Veykril minor : Deunwrap generate_delegate_methods #15398 subtask 8
minor : Deunwrap generate_derive #15398 subtask 1. Since the editing closure has arms, I did something *experimental* ( in this case just a clever term for bad code ) to bypass creating an `Option` but I am ready to change this.
… r=Veykril minor : Deunwrap wrap_return_type_in_result #15398 subtask 7
minor : Deunwrap extract_function #15398 subtask 5.
minor : Deunwrap inline call #15398 subtask 4. There is still one instance of unwrap, which I found pretty hard to change.
minor : Deunwrap inline call #15398 subtask 4. There is still one instance of unwrap, which I found pretty hard to change.
…eykril Deunwrap add_missing_match_arms Last subtask of #15398
…ykril minor : Deunwrap convert_comment_block and desugar_doc_comment Closes subtask 13 of #15398 . I still don't know a more idiomatic way for the for loops I added, any suggestion would make me happy.
can this be closed because all the tasks have been completed? |
Almost. I think there are a couple more in |
can i potentially look into doing those? |
Sure. Check out lines 407 and 686 in The other thing I wanted to have is a |
is there a place i can ask for guidance? some of these aren't that clear - for example line 406 suggests that the unwrap is fine? or am i misinterpreting it. |
Yeah, I meant replacing |
should be all good, not sure about the |
Historically, the assists have been one of our major source of crashes, usually because they didn't handle invalid or incomplete code. Let's try to clean these up a bit.
Here are the ones I've found, though some of the usages there might actually be correct.
unwrap
fromRemove dbg!
#15424generate_default_from_new
when impl self ty is missing #15406The text was updated successfully, but these errors were encountered: