-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
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.
Description
Namely for all comparison operators they should be allowed to be chained. The easy way of disambiguating them is since they are all binary operators just chain them with &&
. Lastly, this can help with code clearness since the following can be avoided
let x = fn_long();
let y = fn_other();
if 5 < x && x < 10 && y <= x && 5 < y {
...
}
and replaced with:
if 5 < fn_other() <= fn_long() < 10 {
}
where the return values of any non_constant is held in reserve so that the function isn't called multiple times.
strega-nil, vext01, Restioson, sp5, Emerentius and 23 moreeddyb, est31, oli-obk, joshtriplett and 7 morescottmcm
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.