-
Notifications
You must be signed in to change notification settings - Fork 1.7k
if let && bool #2411
Copy link
Copy link
Closed
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.
Metadata
Metadata
Assignees
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.
Type
Fields
Give feedbackNo fields configured for issues without a type.
First, there are currently 474 issues|PRs here that contain "if let", so I hope I'm not duplicating something already discussed.
This idea is quite close to #929, but instead of allowing to
&&lets, it'd allow to&&with abool.Basically, the idea looks like this:
This pattern is something that frequently occurred to me, and I'm finding it painful to always look for workarounds.
The constraints to this pattern would be:
if let Some((a, b)) = x && a > 42 && let Some(c) = b.unwrap()for later (modulo Support && in if let expressions #929)What do you think about this idea?