{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreidi65ngj4m5ksxkkjzwsd5zaigg4fp3jmmhprfft5ce7zm2n3rvl4",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mmrgkzlysj32"
},
"path": "/t/what-is-allocator-by-ref-for/24356#post_10",
"publishedAt": "2026-05-26T15:42:54.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "rne:\n\n> What's the benefit of these kind of associated functions over `impl AsMut<Self> for ...`?\n\nAvoiding amiguity for the sake of inference.\n\nrne:\n\n> And, having `AsRef` and `AsMut` in mind, why is it called `by_ref` and not `by_mut` although it returns a _mutable_ reference?\n\nPerhaps (in the case of `Iterator`) it's as simple as, it only makes sense for `&mut`. (OTOH it's a 1.0 method, there may not have been much conversation. I didn't dig.)",
"title": "What is Allocator::by_ref for?"
}