You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems like it would need an explicit feature boundary: no_std + alloc + hashbrown, rather than plain no_std. If the crate already has APIs whose availability depends on allocation, documenting that counts/into_group_map style methods require the same allocation-backed feature would make the tradeoff clear. The main compatibility question is probably whether pulling in hashbrown is acceptable as an optional dependency for users who currently rely on a very small feature set.
What if, instead of importing hashbrown, we implemented it from scratch using alloc—would that be too much of a hassle?
I feel that limiting it to std would be a loss for itertools.
We could introduce our own trait that offers precisely what we need for our methods. Then, we could implement it for std::collections::HashMap, and - under feature flags - implement it for widely used foreign HashMap alternative. Plus, users could implement it for their own types.
Activity
hiSandog commentedon Jun 30, 2026
This seems like it would need an explicit feature boundary:
no_std + alloc + hashbrown, rather than plainno_std. If the crate already has APIs whose availability depends on allocation, documenting thatcounts/into_group_mapstyle methods require the same allocation-backed feature would make the tradeoff clear. The main compatibility question is probably whether pulling inhashbrownis acceptable as an optional dependency for users who currently rely on a very small feature set.fxdmhtt commentedon Jun 30, 2026
What if, instead of importing
hashbrown, we implemented it from scratch usingalloc—would that be too much of a hassle?I feel that limiting it to
stdwould be a loss foritertools.phimuemue commentedon Jun 30, 2026
We could introduce our own trait that offers precisely what we need for our methods. Then, we could implement it for
std::collections::HashMap, and - under feature flags - implement it for widely used foreignHashMapalternative. Plus, users could implement it for their own types.fxdmhtt commentedon Jun 30, 2026
I am delighted that you have given this such thorough consideration.
phimuemue commentedon Jun 30, 2026
Does anybody know if we have precedence for this tactics in our code base?