Merge pull request #198 from aleksuss/doc-tests-fix

Got rid of some rust compiler warnings.
master
Jordan Terrell 6 years ago committed by GitHub
commit e7da7ec72c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/db_options.rs
  2. 6
      src/merge_operator.rs

@ -1061,11 +1061,15 @@ impl Options {
} }
} }
/// When a `prefix_extractor` is defined through `opts.set_prefix_extractor` this creates a /// When a `prefix_extractor` is defined through `opts.set_prefix_extractor` this
/// prefix bloom filter for each memtable with the size of /// creates a prefix bloom filter for each memtable with the size of
/// `write_buffer_size * memtable_prefix_bloom_ratio` (capped at 0.25). /// `write_buffer_size * memtable_prefix_bloom_ratio` (capped at 0.25).
/// ///
/// Default: `0` /// Default: `0`
///
/// # Example
///
/// ```
/// use rocksdb::{Options, SliceTransform}; /// use rocksdb::{Options, SliceTransform};
/// ///
/// let mut opts = Options::default(); /// let mut opts = Options::default();

@ -278,7 +278,7 @@ mod test {
#[repr(packed)] #[repr(packed)]
#[derive(Clone, Debug)] #[derive(Copy, Clone, Debug)]
struct ValueCounts { struct ValueCounts {
num_a: u32, num_a: u32,
num_b: u32, num_b: u32,
@ -423,7 +423,7 @@ mod test {
match db.get(b"k2") { match db.get(b"k2") {
Ok(Some(value)) => { Ok(Some(value)) => {
match from_slice::<ValueCounts>(&*value) { match from_slice::<ValueCounts>(&*value) {
Some(v) => { Some(v) => unsafe {
assert_eq!(v.num_a, 1000); assert_eq!(v.num_a, 1000);
assert_eq!(v.num_b, 500); assert_eq!(v.num_b, 500);
assert_eq!(v.num_c, 2000); assert_eq!(v.num_c, 2000);
@ -438,7 +438,7 @@ mod test {
match db.get(b"k1") { match db.get(b"k1") {
Ok(Some(value)) => { Ok(Some(value)) => {
match from_slice::<ValueCounts>(&*value) { match from_slice::<ValueCounts>(&*value) {
Some(v) => { Some(v) => unsafe {
assert_eq!(v.num_a, 3); assert_eq!(v.num_a, 3);
assert_eq!(v.num_b, 2); assert_eq!(v.num_b, 2);
assert_eq!(v.num_c, 0); assert_eq!(v.num_c, 0);

Loading…
Cancel
Save