Hi, it would be nice if a insert_or_get_mut() would exist.
my use case:
The Qp tries store bitmaps. I have a new bitmap A associated with the key 1. I would like the perform a binary and operation if a bitmap B for key 1 is already in the trie otherwise I would like to insert A. So that the value of key 1 is now A & B.
Currently I simple call .insert(A). If I get Some as return value I perform insert(A & B) again. But so I must run twice through the trie.
Hi, it would be nice if a
insert_or_get_mut()
would exist.my use case: The Qp tries store bitmaps. I have a new bitmap
A
associated with the key1
. I would like the perform a binary and operation if a bitmapB
for key1
is already in the trie otherwise I would like to insertA
. So that the value of key1
is nowA & B
.Currently I simple call
.insert(A)
. If I getSome
as return value I performinsert(A & B)
again. But so I must run twice through the trie.