diff --git a/src/backend/impl_lmdb/cursor.rs b/src/backend/impl_lmdb/cursor.rs index 1edafd5..3548405 100644 --- a/src/backend/impl_lmdb/cursor.rs +++ b/src/backend/impl_lmdb/cursor.rs @@ -19,7 +19,7 @@ pub struct RoCursorImpl<'c>(pub(crate) lmdb::RoCursor<'c>); impl<'c> BackendRoCursor<'c> for RoCursorImpl<'c> { type Iter = IterImpl<'c, lmdb::RoCursor<'c>>; - fn get_key_value(self, key: K, value: crate::value::Value) -> bool + fn get_key_value(self, key: K, value: &crate::value::Value) -> bool where K: AsRef<[u8]> + 'c, { @@ -68,7 +68,7 @@ pub struct RwCursorImpl<'c>(pub(crate) lmdb::RoCursor<'c>); impl<'c> BackendRoCursor<'c> for RwCursorImpl<'c> { type Iter = IterImpl<'c, lmdb::RoCursor<'c>>; - fn get_key_value(self, key: K, value: crate::value::Value) -> bool + fn get_key_value(self, key: K, value: &crate::value::Value) -> bool where K: AsRef<[u8]> + 'c, { diff --git a/src/backend/impl_safe/cursor.rs b/src/backend/impl_safe/cursor.rs index 169a582..2531437 100644 --- a/src/backend/impl_safe/cursor.rs +++ b/src/backend/impl_safe/cursor.rs @@ -18,7 +18,7 @@ pub struct RoCursorImpl<'c>(pub(crate) &'c Snapshot); impl<'c> BackendRoCursor<'c> for RoCursorImpl<'c> { type Iter = IterImpl<'c>; - fn get_key_value(self, key: K, value: crate::value::Value) -> bool { + fn get_key_value(self, key: K, value: &crate::value::Value) -> bool { unimplemented!(); } @@ -53,7 +53,7 @@ impl<'c> BackendRoCursor<'c> for RoCursorImpl<'c> { impl<'c> BackendRoCursor<'c> for RoCursorImpl<'c> { type Iter = IterImpl<'c>; - fn get_key_value(self, key: K, value: crate::value::Value) -> bool + fn get_key_value(self, key: K, value: &crate::value::Value) -> bool where K: AsRef<[u8]> + 'c, { @@ -97,7 +97,7 @@ pub struct RwCursorImpl<'c>(&'c mut Snapshot); impl<'c> BackendRoCursor<'c> for RwCursorImpl<'c> { type Iter = IterImpl<'c>; - fn get_key_value(self, key: K, value: crate::value::Value) -> bool + fn get_key_value(self, key: K, value: &crate::value::Value) -> bool where K: AsRef<[u8]> + 'c, { diff --git a/src/backend/traits.rs b/src/backend/traits.rs index abe2053..b4ab9ee 100644 --- a/src/backend/traits.rs +++ b/src/backend/traits.rs @@ -212,7 +212,7 @@ pub trait BackendRwDupPrevCursorTransaction: BackendRwTransaction { pub trait BackendRoCursor<'c>: Debug { type Iter: BackendIter<'c>; - fn get_key_value(self, key: K, value: crate::value::Value) -> bool + fn get_key_value(self, key: K, value: &crate::value::Value) -> bool where K: AsRef<[u8]> + 'c; diff --git a/src/store/multi.rs b/src/store/multi.rs index 2ea85c9..f50b007 100644 --- a/src/store/multi.rs +++ b/src/store/multi.rs @@ -91,7 +91,7 @@ where &self, reader: &'r R, k: K, - v: Value, + v: &Value, ) -> Result where R: Readable<'r, Database = D, RoCursor = C>, diff --git a/tests/env-lmdb.rs b/tests/env-lmdb.rs index a8a8215..6354fed 100644 --- a/tests/env-lmdb.rs +++ b/tests/env-lmdb.rs @@ -1201,17 +1201,17 @@ fn test_multi_get_key_value() { let reader = k.read().unwrap(); let yes = sk - .get_key_value(&reader, "foo", Value::Blob(b"1234")) + .get_key_value(&reader, "foo", &Value::Blob(b"1234")) .unwrap(); assert!(yes); let yes = sk - .get_key_value(&reader, "foo", Value::Blob(b"12345")) + .get_key_value(&reader, "foo", &Value::Blob(b"12345")) .unwrap(); assert!(!yes); let yes = sk - .get_key_value(&reader, "foo2", Value::Blob(b"1234")) + .get_key_value(&reader, "foo2", &Value::Blob(b"1234")) .unwrap(); assert!(!yes); }