fix prefix iterator by using a prefix extractor

master
Tyler Neely 7 years ago
parent 12093252c6
commit ba186b4bfa
No known key found for this signature in database
GPG Key ID: 23E6C4FBEAE5E4E3
  1. 6
      tests/test_iterator.rs

@ -163,7 +163,11 @@ pub fn test_prefix_iterator() {
let b1: Box<[u8]> = key(b"bbb1");
let b2: Box<[u8]> = key(b"bbb2");
let db = DB::open_default(path).unwrap();
let mut opts = Options::default();
let prefix_extractor = rocksdb::SliceTransform::create_fixed_prefix(3);
opts.set_prefix_extractor(prefix_extractor);
let db = DB::open(&opts, path).unwrap();
assert!(db.put(&*a1, &*a1).is_ok());
assert!(db.put(&*a2, &*a2).is_ok());

Loading…
Cancel
Save