touchups to make arkpar's backport work

master
Tyler Neely 9 years ago
parent cc6e143318
commit 740f3735d0
No known key found for this signature in database
GPG Key ID: 23E6C4FBEAE5E4E3
  1. 6
      src/ffi.rs
  2. 3
      src/rocksdb_options.rs

@ -422,7 +422,7 @@ fn internal() {
unsafe {
use std::ffi::CString;
let opts = rocksdb_options_create();
assert!(!opts.0.is_null());
assert!(!opts.is_null());
rocksdb_options_increase_parallelism(opts, 0);
rocksdb_options_optimize_level_style_compaction(opts, 0);
@ -441,7 +441,7 @@ fn internal() {
assert!(err.is_null());
let writeopts = rocksdb_writeoptions_create();
assert!(!writeopts.0.is_null());
assert!(!writeopts.is_null());
let key = b"name\x00";
let val = b"spacejam\x00";
@ -456,7 +456,7 @@ fn internal() {
assert!(err.is_null());
let readopts = rocksdb_readoptions_create();
assert!(!readopts.0.is_null());
assert!(!readopts.is_null());
let val_len: size_t = 0;
let val_len_ptr = &val_len as *const size_t;

@ -329,8 +329,7 @@ impl Options {
impl WriteOptions {
pub fn new() -> WriteOptions {
let write_opts = unsafe { rocksdb_ffi::rocksdb_writeoptions_create() };
let rocksdb_ffi::DBWriteOptions(opt_ptr) = write_opts;
if opt_ptr.is_null() {
if write_opts.is_null() {
panic!("Could not create rocksdb write options".to_string());
}
WriteOptions { inner: write_opts }

Loading…
Cancel
Save