From 5a2647a436a3017784dec33b9388833b645bb423 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Tue, 31 Jul 2018 16:12:14 +0300 Subject: [PATCH] Got rid of some rust compiler warnings. --- src/db_options.rs | 8 ++++++-- src/merge_operator.rs | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/db_options.rs b/src/db_options.rs index ba9bbad..9d252fb 100644 --- a/src/db_options.rs +++ b/src/db_options.rs @@ -1061,11 +1061,15 @@ impl Options { } } - /// When a `prefix_extractor` is defined through `opts.set_prefix_extractor` this creates a - /// prefix bloom filter for each memtable with the size of + /// When a `prefix_extractor` is defined through `opts.set_prefix_extractor` this + /// creates a prefix bloom filter for each memtable with the size of /// `write_buffer_size * memtable_prefix_bloom_ratio` (capped at 0.25). /// /// Default: `0` + /// + /// # Example + /// + /// ``` /// use rocksdb::{Options, SliceTransform}; /// /// let mut opts = Options::default(); diff --git a/src/merge_operator.rs b/src/merge_operator.rs index ef86323..70a202c 100644 --- a/src/merge_operator.rs +++ b/src/merge_operator.rs @@ -278,7 +278,7 @@ mod test { #[repr(packed)] - #[derive(Clone, Debug)] + #[derive(Copy, Clone, Debug)] struct ValueCounts { num_a: u32, num_b: u32, @@ -423,7 +423,7 @@ mod test { match db.get(b"k2") { Ok(Some(value)) => { match from_slice::(&*value) { - Some(v) => { + Some(v) => unsafe { assert_eq!(v.num_a, 1000); assert_eq!(v.num_b, 500); assert_eq!(v.num_c, 2000); @@ -438,7 +438,7 @@ mod test { match db.get(b"k1") { Ok(Some(value)) => { match from_slice::(&*value) { - Some(v) => { + Some(v) => unsafe { assert_eq!(v.num_a, 3); assert_eq!(v.num_b, 2); assert_eq!(v.num_c, 0);