External Publication
Visit Post

Introduce a way to construct Range from start + length

Rust Internals [Unofficial] March 18, 2026
Source

yaksher:

I’m not sure I follow why it should be 'a'..+25 rather than 'a'..+26. [...] since .. is an exclusive range so the number is the length of the range and 'a' + 26 is the character after 'z' as it should be.

You're right, I forgot that .. is exclusive of the endpoint -- which means the original example of 'a' .. 'z' is probably incorrect, and I think that's actually an argument in favor of adding ..+.

Discussion in the ATmosphere

Loading comments...