fdb-rs / fdb

FoundationDB client API for Tokio
https://fdb-rs.github.io/
Apache License 2.0
43 stars 2 forks source link

Simplify `KeyValue` API to avoid unnecessary clone #12

Closed rajivr closed 2 years ago

rajivr commented 2 years ago

In the current implementation, methods on a value of KeyValue type, returns a ref type (&Key or &Value).

However, in most cases, this is followed by a clone, in-order to get a owned value of either Key or Value type. Therefore, the API can be simplified to

fn into_key(self) -> Key
fn into_value(self) -> Value
fn into_parts(self) -> (Key, Value)

This is a breaking change, so schedule it for 0.3 release.

rajivr commented 2 years ago

Implemented in 21bcc47.