From d50574f9f268b4febf2d994f06927623683a32b1 Mon Sep 17 00:00:00 2001 From: Richard Dodd Date: Mon, 9 Jan 2017 14:07:03 +0000 Subject: [PATCH] Make requested changes --- src/db.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/db.rs b/src/db.rs index 215fdff..c6cb776 100644 --- a/src/db.rs +++ b/src/db.rs @@ -510,14 +510,14 @@ impl DB { .to_owned())) } }; - let cf_handler = unsafe { + let cf = unsafe { let cf_handler = ffi_try!(ffi::rocksdb_create_column_family(self.inner, opts.inner, cname.as_ptr())); - let cf_handler = ColumnFamily { inner: cf_handler }; - self.cfs.insert(name.to_string(), cf_handler); - cf_handler + let cf = ColumnFamily { inner: cf_handler }; + self.cfs.insert(name.to_string(), cf); + cf }; - Ok(cf_handler) + Ok(cf) } pub fn drop_cf(&mut self, name: &str) -> Result<(), Error> { @@ -533,7 +533,7 @@ impl DB { /// Return the underlying column family handle. pub fn cf_handle(&self, name: &str) -> Option { - self.cfs.get(name).map(|cf| *cf) + self.cfs.get(name).cloned() } pub fn iterator(&self, mode: IteratorMode) -> DBIterator {