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
Currently HashMap::compute requires an FnMut and has no way of persisting state. For example, inserting a V requires cloning if the operation fails and is retried. Internally we memoize all inserts to avoid this, but that's a hack that shouldn't be expose to users. Instead we might want to provide an on_failure(Operation<V>) hook to allow state to be reset. I don't want the API to become convoluted, so maybe just guaranteeing that inserts are memoized is simpler?
The text was updated successfully, but these errors were encountered:
Currently
HashMap::compute
requires anFnMut
and has no way of persisting state. For example, inserting aV
requires cloning if the operation fails and is retried. Internally we memoize all inserts to avoid this, but that's a hack that shouldn't be expose to users. Instead we might want to provide anon_failure(Operation<V>)
hook to allow state to be reset. I don't want the API to become convoluted, so maybe just guaranteeing that inserts are memoized is simpler?The text was updated successfully, but these errors were encountered: