crodas / microredis

Redis server implemented in rust.
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Introduce `get_map` which replaces `get_map_or` #61

Closed crodas closed 1 year ago

crodas commented 1 year ago

This new function receives a single Fn to pass the data, which is an option, instead of two functions.

Having a single function let the develeper take ownership of data when data is found and it is not found, the two more popular cases.

Prior this PR, any data to be stored would have been cloned for each function.