{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreibfif4mpkxgyjvhcshcyoyvyjkgxg46yuhwdxx45r44wk36zjnz7m",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mgtygm6dkjo2"
},
"path": "/t/introduce-a-way-to-construct-range-from-start-length/24073#post_1",
"publishedAt": "2026-03-12T07:39:22.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "Currently the only way to construct such range is via `start..(start + length)`\n\nInstead, we would be able to do it via `Range::from_len(start, length)`\n\nOr, via a new custom syntax `start..+length`\n\n * This would help avoid off-by-one errors / wrongly defined ranges (ex: `start..length`)\n * Doesn't have a possibility to express an invalid (`start > end`) range\n * Reduce boilerplate (repeating `start`)\n * Is generally the more natural way to express a range\n\n\n\n(Instead of len/length it can be count/width/offset)",
"title": "Introduce a way to construct Range from start + length"
}