{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreihbsm4xt2pszq23452psl2cqfb3fwn5m2zz63vn6h5qlrksdv4q6u",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mgzal3phfuq2"
},
"path": "/t/introduce-a-way-to-construct-range-from-start-length/24073?page=2#post_23",
"publishedAt": "2026-03-14T02:01:54.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "scottmcm:\n\n> How about just a function? `Range::from_start_and_len(start, length)` would be fine, no new type.\n\nI'll ask again: what is the type signature of `from_start_and_len`? Are both `T`? If so, what of the signed types and negative `length`? Perhaps `T` and `Into<T::Unsigned>` to at least remove the negative-ness concern? Should there be a `try_` variant that catches that and overflow? If it is \"just\" `Add`-gated, what about floating point types? What is `f32::Unsigned` if that path is chosen? Or perhaps this only makes sense for `usize` at all?",
"title": "Introduce a way to construct Range from start + length"
}