@ -671,18 +671,17 @@ impl DB {
};
let mut length = 0;
let vec;
unsafe {
let ptr = ffi_try!(ffi::rocksdb_list_column_families(opts.inner,
cpath.as_ptr() as *const _,
&mut length));
vec = Vec::from_raw_parts(ptr, length, length).iter().map(|&ptr| {
let vec = Vec::from_raw_parts(ptr, length, length).iter().map(|&ptr| {
CString::from_raw(ptr).into_string().unwrap()
}).collect();
Ok(vec)
}
@ -68,7 +68,7 @@ pub fn test_column_family() {
let opts = Options::default();
let vec = DB::list_cf(&opts, path);
match vec {
Ok(vec) => println!("list cf: {:?}", vec),
Ok(vec) => assert_eq!(vec, vec!["default", "cf1"]),
Err(e) => panic!("failed to drop column family: {}", e),