Fix clippy warnings (#691)

master
walter 2 years ago committed by GitHub
parent 76d85e9c70
commit 6cd1c020b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/compaction_filter.rs
  2. 2
      src/compaction_filter_factory.rs
  3. 2
      src/comparator.rs
  4. 6
      src/merge_operator.rs
  5. 2
      src/slice_transform.rs
  6. 2
      src/write_batch.rs

@ -100,7 +100,7 @@ pub unsafe extern "C" fn destructor_callback<F>(raw_cb: *mut c_void)
where
F: CompactionFilter,
{
Box::from_raw(raw_cb as *mut F);
drop(Box::from_raw(raw_cb as *mut F));
}
pub unsafe extern "C" fn name_callback<F>(raw_cb: *mut c_void) -> *const c_char

@ -30,7 +30,7 @@ pub unsafe extern "C" fn destructor_callback<F>(raw_self: *mut c_void)
where
F: CompactionFilterFactory,
{
Box::from_raw(raw_self as *mut F);
drop(Box::from_raw(raw_self as *mut F));
}
pub unsafe extern "C" fn name_callback<F>(raw_self: *mut c_void) -> *const c_char

@ -26,7 +26,7 @@ pub struct ComparatorCallback {
}
pub unsafe extern "C" fn destructor_callback(raw_cb: *mut c_void) {
Box::from_raw(raw_cb as *mut ComparatorCallback);
drop(Box::from_raw(raw_cb as *mut ComparatorCallback));
}
pub unsafe extern "C" fn name_callback(raw_cb: *mut c_void) -> *const c_char {

@ -77,7 +77,7 @@ pub struct MergeOperatorCallback<F: MergeFn, PF: MergeFn> {
}
pub unsafe extern "C" fn destructor_callback<F: MergeFn, PF: MergeFn>(raw_cb: *mut c_void) {
Box::from_raw(raw_cb as *mut MergeOperatorCallback<F, PF>);
drop(Box::from_raw(raw_cb as *mut MergeOperatorCallback<F, PF>));
}
pub unsafe extern "C" fn delete_callback(
@ -86,10 +86,10 @@ pub unsafe extern "C" fn delete_callback(
value_length: size_t,
) {
if !value.is_null() {
Box::from_raw(slice::from_raw_parts_mut(
drop(Box::from_raw(slice::from_raw_parts_mut(
value as *mut u8,
value_length as usize,
));
)));
}
}

@ -83,7 +83,7 @@ pub struct TransformCallback<'a> {
}
pub unsafe extern "C" fn slice_transform_destructor_callback(raw_cb: *mut c_void) {
Box::from_raw(raw_cb as *mut TransformCallback);
drop(Box::from_raw(raw_cb as *mut TransformCallback));
}
pub unsafe extern "C" fn slice_transform_name_callback(raw_cb: *mut c_void) -> *const c_char {

@ -122,7 +122,7 @@ impl<const TRANSACTION: bool> WriteBatchWithTransaction<TRANSACTION> {
);
// we must manually set the raw box free since there is no
// associated "destroy" callback for this object
Box::from_raw(state);
drop(Box::from_raw(state));
}
}

Loading…
Cancel
Save