jonhoo / flurry

A port of Java's ConcurrentHashMap to Rust
Apache License 2.0
533 stars 49 forks source link

Make HashMap::put return more info #76

Closed jonhoo closed 4 years ago

jonhoo commented 4 years ago

Now, put will let you know both what it ended up doing (insert, replace, or nothing if no_replacement is set). This enables it to be used in more settings. The return value also now carries information about both the previous and new value for the key, which may be useful in certain contexts.

Needed for #74


This change is Reviewable

GarkGarcia commented 4 years ago

Great! As soon as this is merged I'll resume work on #74.

domenicquirl commented 4 years ago

Why are the comments out of order now? D: Someday I'll get behind the mysterious workings of reviews...

jonhoo commented 4 years ago

@domenicquirl is that change along the lines of what you were thinking?

domenicquirl commented 4 years ago

Yes, that's exactly what I thought 😊