aboutsummaryrefslogtreecommitdiff
path: root/src/db/lmdb_adapter.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-06-06 11:30:10 +0200
committerAlex Auvolat <alex@adnab.me>2022-06-06 11:30:10 +0200
commit4f5d17d46464b09a9e238bf959d14f3127a129cc (patch)
tree7dcb49efdf046c8435b7643ecba3178ea1747bc1 /src/db/lmdb_adapter.rs
parent2d5541b0e7ed0939e99710f40d3859c05bc31175 (diff)
downloadgarage-4f5d17d46464b09a9e238bf959d14f3127a129cc.tar.gz
garage-4f5d17d46464b09a9e238bf959d14f3127a129cc.zip
fixes
Diffstat (limited to 'src/db/lmdb_adapter.rs')
-rw-r--r--src/db/lmdb_adapter.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/db/lmdb_adapter.rs b/src/db/lmdb_adapter.rs
index 095f512b..aa365733 100644
--- a/src/db/lmdb_adapter.rs
+++ b/src/db/lmdb_adapter.rs
@@ -230,7 +230,10 @@ impl<'a, 'db> ITx for LmdbTx<'a, 'db> {
fn get(&self, tree: usize, key: &[u8]) -> Result<Option<Value<'_>>> {
let tree = self.get_tree(tree)?;
match tree.get(&self.tx, &key)? {
- Some(v) => Ok(Some(Value(Box::new(v)))),
+ Some(v) => {
+ let v: &'_ [u8] = v;
+ Ok(Some(v.into()))
+ }
None => Ok(None),
}
}
@@ -372,7 +375,11 @@ where
match iter_ref.unwrap().next() {
None => None,
Some(Err(e)) => Some(Err(e.into())),
- Some(Ok((k, v))) => Some(Ok((k.into(), v.into()))),
+ Some(Ok((k, v))) => {
+ let k: &'a [u8] = k;
+ let v: &'a [u8] = v;
+ Some(Ok((k.into(), v.into())))
+ }
}
}
}