Which of the two syntaxes for range patterns is preferred? (Solved, use ..=)

#1

TIL that 0 ..= 92 is valid pattern (playground) which means the same as 0 ... 92. Which syntax is the preferred one? Do we plan to deprecate the other?

I also think that this wasn’t mentioned in release notes for 1.26, when this was stabilized?

0 Likes

#2

Googling around more turns up this issue which suggests that ..= is the way to go and that ... is deprecated in the idioms lint group.

2 Likes

#3

It’s been mentioned in the release blog post as well as in the release notes.

0 Likes

#4

That is for ranges (std::ops::RangeInclusive), not for patterns.

0 Likes

#5

Oops, I see. Spoke too soon. Sorry for the noise.

0 Likes

closed #6

This topic was automatically closed after 26 hours. New replies are no longer allowed.

0 Likes