Closed ModProg closed 11 months ago
Same would be nice for #103
The initial idea is good and easy, will be pushed shortly.
Same would be nice for #103
Unfortunately, this isn't the same case. With this API, the update function may never be called if the insert function is used instead. Since the insert function already has a return type, we'd have to make the actual result be wrapped in an option, and I'm not sure I like that very much.
yeah, makes sense, but my usage actually is the upsert, but I can just keep my workaround of trying to insert the default value first.
I'd be fine with having the Option though, it'd be the same as calling insert
on, e.g., a HashMap
.
it'd be the same as calling insert on, e.g., a HashMap
The NamedCollection::entry
API is inspired by HashMap::entry()
, which operates the way it does based on how HashMap's and_modify
works.
I'm using
CollectionDocument::modify_async
to modify aHashSet::remove
and want to pass the result of that back up to the caller.I'd like to be able to do