-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Remove some unnecessary try-related type annotations
#151887
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
base: main
Are you sure you want to change the base?
Conversation
I left a few, like
```rust
let result: Result<_, ModError<'_>> = try {
```
where it felt like seeing it might still be useful for the reader.
Feel free to push back on any of these changes if you think seeing the type would be better.
|
Some changes occurred in need_type_info.rs cc @lcnr |
| } | ||
| } | ||
| } | ||
| .unwrap_or_default() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
annot: the whitespace changed here, so you might want the ignore whitespace diff for this function.
|
|
||
| let generics = tcx.generics_of(def_id); | ||
| let segment: Option<_> = try { | ||
| if !segment.infer_args || generics.has_impl_trait() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
old code seems simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this one didn't have any ? inside the try, my instinct was that just using None instead of do yeet; was more direct.
|
I think that in a lot of the |
I left a few, like
where it felt like seeing it might still be useful for the reader.
Feel free to push back on any of these changes if you think they should be left alone.