From 9fcf924d229f5d3c7135f5332ed959407b40e9f3 Mon Sep 17 00:00:00 2001 From: Rick Richardson Date: Sun, 22 Oct 2017 12:47:22 -0700 Subject: [PATCH] clean up trace --- src/db_options.rs | 5 ----- src/merge_operator.rs | 10 ++-------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/db_options.rs b/src/db_options.rs index 05a68c3..45eefb1 100644 --- a/src/db_options.rs +++ b/src/db_options.rs @@ -201,11 +201,6 @@ impl Options { } pub fn set_merge_operator(&mut self, name: &str, full_merge_fn: MergeFn, partial_merge_fn: Option) { - if partial_merge_fn.is_none() { - println!("partial_merge not supplied, defaulting partial merge to full"); - } else { - println!("using supplied partial_merge function"); - } let cb = Box::new(MergeOperatorCallback { name: CString::new(name.as_bytes()).unwrap(), full_merge_fn: full_merge_fn, diff --git a/src/merge_operator.rs b/src/merge_operator.rs index da09aee..c451f4f 100644 --- a/src/merge_operator.rs +++ b/src/merge_operator.rs @@ -123,7 +123,6 @@ pub unsafe extern "C" fn partial_merge_callback( success: *mut u8, new_value_length: *mut size_t, ) -> *mut c_char { - println!("In partial_merge_callback"); let cb = &mut *(raw_cb as *mut MergeOperatorCallback); let operands = &mut MergeOperands::new(operands_list, operands_list_len, num_operands); let key = slice::from_raw_parts(raw_key as *const u8, key_len as usize); @@ -221,7 +220,6 @@ mod test { Some(result) } -#[ignore] #[test] fn mergetest() { use {DB, Options}; @@ -295,7 +293,6 @@ mod test { ) -> Option> { let nops = operands.size_hint().0; let mut result: Vec = Vec::with_capacity(nops); - println!("Partial merge operands size hint {}", nops); for op in operands { for e in op { result.push(*e); @@ -311,13 +308,10 @@ mod test { ) -> Option> { let nops = operands.size_hint().0; - println!("Full merge operands size hint {}", nops); let mut counts : ValueCounts = if let Some(v) = existing_val { - println!("Full merge unpacking ValueCounts from {:?}", v); from_slice::(v).unwrap().clone() } else { - println!("Full merge creating new ValueCounts"); ValueCounts { num_a: 0, num_b: 0, @@ -440,7 +434,7 @@ mod test { None => panic!("Failed to get ValueCounts from db"), } } - Err(_) => println!("error reading value"), + Err(e) => panic!("error reading value {:?}", e), _ => panic!("value not present"), } match db.get(b"k1") { @@ -455,7 +449,7 @@ mod test { None => panic!("Failed to get ValueCounts from db"), } } - Err(_) => println!("error reading value"), + Err(e) => panic!("error reading value {:?}", e), _ => panic!("value not present"), } }