k3dom commented on PR #140: URL: https://github.com/apache/datasketches-rust/pull/140#issuecomment-4809159266
Agree on making estimate/lower_bound/upper_bound generic over Borrow<Q> and ToOwned<Owned = T> being an odd bound, will change. On update though, insert always stores the key so it has to own it, but adjust_or_put_value is get-or-increment: when the item's already tracked (the common case here) it just bumps a counter and never stores the key, so there's nothing to own. Closer to the entry API than insert. std's entry can't take a borrowed key either, which is why e.g. hashbrown has entry_ref. Otherwise a hot-key stream allocates a String per hit just to drop it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
