{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreidius4jbh3ryclktb7zbczvosih6ruetxzjtibfl5buffansbugoa",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mjmyoofvpgg2"
},
"path": "/t/t-sort-by-index-and-t-sort-by-key-and-index/24172#post_13",
"publishedAt": "2026-04-16T17:55:17.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "Hmm, since we _have_ the \"apply a permutation\" code, maybe it would be reasonable to start with an `unsafe` method exposing that? They you could always make your own permutation however you need to without also needing to apply it yourself.\n\nI don't know a great (non-allocating) way to check that something _is_ a permutation, though, for a safe API...",
"title": "`<[T]>::sort_by_index` and `<[T]>::sort_by_key_and_index`"
}