Skip to content
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

use ..= instead of ... for range pattern matching #1757

Closed
joekyo opened this issue Jan 9, 2019 · 2 comments · Fixed by #1977
Closed

use ..= instead of ... for range pattern matching #1757

joekyo opened this issue Jan 9, 2019 · 2 comments · Fixed by #1977
Labels

Comments

@joekyo
Copy link

joekyo commented Jan 9, 2019

According to the reference, ... is kept for backwards compatibility.

@joekyo
Copy link
Author

joekyo commented Jan 9, 2019

It seems that the reference recommend us to use ..=.
While the book only introduces ..., and ..= only appears in the appendix of the book.

book $ rg -F '..='
src/appendix-02-operators.md
42:| `..=` | `..=expr`, `expr..=expr` | Right-inclusive range literal | |

@joekyo
Copy link
Author

joekyo commented Jan 9, 2019

Oh, even the ..= in the appendix is a range literal operator but not range pattern operator.
So the book doesn't mention about ..= as an inclusive range pattern operator at all.

kevinmehall added a commit to kevinmehall/rust-book that referenced this issue Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants