From 740f3735d04d179b29f47c4f7169f9a004dd67a3 Mon Sep 17 00:00:00 2001 From: Tyler Neely Date: Sun, 1 May 2016 16:42:36 -0700 Subject: [PATCH] touchups to make arkpar's backport work --- src/ffi.rs | 6 +++--- src/rocksdb_options.rs | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ffi.rs b/src/ffi.rs index 5f36276..c8f5777 100644 --- a/src/ffi.rs +++ b/src/ffi.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; diff --git a/src/rocksdb_options.rs b/src/rocksdb_options.rs index 176afda..6a801d3 100644 --- a/src/rocksdb_options.rs +++ b/src/rocksdb_options.rs @@ -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 }