-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.
Description
std::borrow::Borrow has an extremely limited API, making the following painful:
struct Thing (u8, String);
let m: HashMap<Thing, String> = Default::default();
// how to access m with u8, &str, avoiding allocations?
I recommend changing Borrow into Borrow<'a, T> so you can do Borrow<'a, &'a str> for String
and derive it for multifield structs and stuff, reducing allocations all over the place.
H2CO3
Metadata
Metadata
Assignees
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.