Make requested changes

master
Richard Dodd 8 years ago
parent 63a77d22c9
commit d50574f9f2
  1. 12
      src/db.rs

@ -510,14 +510,14 @@ impl DB {
.to_owned())) .to_owned()))
} }
}; };
let cf_handler = unsafe { let cf = unsafe {
let cf_handler = let cf_handler =
ffi_try!(ffi::rocksdb_create_column_family(self.inner, opts.inner, cname.as_ptr())); ffi_try!(ffi::rocksdb_create_column_family(self.inner, opts.inner, cname.as_ptr()));
let cf_handler = ColumnFamily { inner: cf_handler }; let cf = ColumnFamily { inner: cf_handler };
self.cfs.insert(name.to_string(), cf_handler); self.cfs.insert(name.to_string(), cf);
cf_handler cf
}; };
Ok(cf_handler) Ok(cf)
} }
pub fn drop_cf(&mut self, name: &str) -> Result<(), Error> { pub fn drop_cf(&mut self, name: &str) -> Result<(), Error> {
@ -533,7 +533,7 @@ impl DB {
/// Return the underlying column family handle. /// Return the underlying column family handle.
pub fn cf_handle(&self, name: &str) -> Option<ColumnFamily> { pub fn cf_handle(&self, name: &str) -> Option<ColumnFamily> {
self.cfs.get(name).map(|cf| *cf) self.cfs.get(name).cloned()
} }
pub fn iterator(&self, mode: IteratorMode) -> DBIterator { pub fn iterator(&self, mode: IteratorMode) -> DBIterator {

Loading…
Cancel
Save