{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreieicaqngkxfox6x33xyrydvyqb4nirbibqcthi5jxb5r5nilqdzcy",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mgutcujjhy52"
},
"path": "/t/introduce-a-way-to-construct-range-from-start-length/24073#post_7",
"publishedAt": "2026-03-12T13:57:43.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "It's maybe less a footgun in Rust due to strong integer typing; you know when it's a `usize` vs a `isize`. On the other hand, you may want a `isize` but forget to cast and have `usize` overflow auto-wrapping, so you enter another category of error prone. Anyway, I agree with you.\n\nIt's a bit annoying that sometime, you need `[..s.len() - 1]` but you already have a mutable reference on `s` so you need to extract `s.len()` in a variable, but that's rare enough to make with it.",
"title": "Introduce a way to construct Range from start + length"
}