From 17315fac20f15491d0d668cb257c2c57f61f10f6 Mon Sep 17 00:00:00 2001 From: Ziyang Hu Date: Tue, 25 Oct 2022 23:50:29 +0800 Subject: [PATCH] copy string --- cozorocks/bridge/iter.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cozorocks/bridge/iter.h b/cozorocks/bridge/iter.h index dd9c63c6..2c0861a3 100644 --- a/cozorocks/bridge/iter.h +++ b/cozorocks/bridge/iter.h @@ -103,11 +103,13 @@ struct IterBridge { } inline void seek(RustBytes key) { - iter->Seek(convert_slice(key)); + string k = convert_slice_to_string(key); + iter->Seek(Slice(k)); } inline void seek_backward(RustBytes key) { - iter->SeekForPrev(convert_slice(key)); + string k = convert_slice_to_string(key); + iter->SeekForPrev(Slice(k)); } inline bool is_valid() const {