Increment operator in Rust

That's the wrong question for a language change. All language additions "start with -100 points", because more is bad, all else being equal. The very minimum bar for a language addition is "is this useful enough to overcome the cost of people needing to learn it?".

Thus, for something that's already possible, another way to do it needs to have a combination of being substantially shorter/simpler and that thing being a common enough task to be worth doing. Thus all the feedback in this thread about "the existing way isn't materially longer" and "it's not that common that one needs to do this anyway".

For fun: if you do let x = 4..;, then x++ is x.next().unwrap().

12 Likes