rust-lang / rfcs

RFCs for changes to Rust
https://rust-lang.github.io/rfcs/
Apache License 2.0
5.96k stars 1.57k forks source link

chained comparison #3694

Closed kaorlol closed 2 months ago

kaorlol commented 2 months ago

Would it be a good idea to add chained comparison to rust?

I feel like it would be a good idea to have the ability to do 1 <= num <= 512 instead of having to 1 <= num || num <= 512.

I think having the num || num is more verbose and could be done with chained comparison which is a lot simpler and in my opinion easier to read.

kaorlol commented 2 months ago

https://github.com/rust-lang/rfcs/issues/2083 never mind found this, i like how github search just didnt show this.