Skip to content

Commit 00aa437

Browse files
Keatsboydgreenfield
authored andcommitted
Edition 2018
1 parent f1e7e3f commit 00aa437

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "mmap-bitvec"
33
version = "0.3.0"
44
authors = ["Roderick Bovee <roderick@onecodex.com>"]
55
autobenches = false
6+
edition = "2018"
67

78
[dependencies]
89
memmap = "0.7.0"

benches/benchmark.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
extern crate criterion;
12
extern crate memmap;
23
extern crate mmap_bitvec;
3-
extern crate criterion;
44

55
use std::fs::OpenOptions;
66
use std::mem::transmute;
@@ -9,7 +9,7 @@ use std::ops::Range;
99
use memmap::{MmapMut, MmapOptions};
1010
use mmap_bitvec::{BitVector, MmapBitVec};
1111

12-
use criterion::{black_box, criterion_group, criterion_main, Criterion};
12+
use criterion::{criterion_group, criterion_main, Criterion};
1313

1414
type BitVecSlice = u64;
1515
const BIT_VEC_SLICE_SIZE: u8 = 64;
@@ -152,9 +152,11 @@ fn bench_get_range_actual() {
152152

153153
fn criterion_benchmark(c: &mut Criterion) {
154154
c.bench_function("get_range_actual", |b| b.iter(|| bench_get_range_actual()));
155-
c.bench_function("get_range_simplified", |b| b.iter(|| bench_get_range_simplified()));
155+
c.bench_function("get_range_simplified", |b| {
156+
b.iter(|| bench_get_range_simplified())
157+
});
156158
c.bench_function("get_range", |b| b.iter(|| bench_get_range()));
157159
}
158160

159161
criterion_group!(benches, criterion_benchmark);
160-
criterion_main!(benches);
162+
criterion_main!(benches);

src/bloom.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use std::path::Path;
44

55
use murmurhash3::murmurhash3_x64_128;
66

7-
use bitvec::BitVector;
8-
use mmap_bitvec::MmapBitVec;
7+
use crate::bitvec::BitVector;
8+
use crate::mmap_bitvec::MmapBitVec;
99

1010
// we don't want to use murmurhash3::Murmur3Hasher b/c it makes copies of the
1111
// bytes to be hashed with every single `hash` call

src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
//! mmap-bitvec is a library for using file-backed (via mmap) bit vectors and
22
//! includes common convenience functions and a few data structures built atop
33
//! the included bit vector implementation.
4-
extern crate memmap;
5-
extern crate murmurhash3;
64
75
pub mod bitvec;
86
pub mod bloom;
97
pub mod combinatorial;
108
pub mod mmap_bitvec;
119

10+
#[doc(inline)]
11+
pub use crate::mmap_bitvec::MmapBitVec;
1212
#[doc(inline)]
1313
pub use bitvec::BitVector;
1414
#[doc(inline)]
1515
pub use bloom::BloomFilter;
16-
#[doc(inline)]
17-
pub use mmap_bitvec::MmapBitVec;

src/mmap_bitvec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::path::Path;
77

88
use memmap::{Mmap, MmapMut, MmapOptions};
99

10-
use bitvec::BitVector;
10+
use crate::bitvec::BitVector;
1111

1212
/// Really annoying we have to mock over both of these rather than memmap
1313
/// just providing support.
@@ -642,7 +642,7 @@ mod test {
642642
use std::path::Path;
643643

644644
use super::MmapBitVec;
645-
use bitvec::BitVector;
645+
use crate::bitvec::BitVector;
646646

647647
#[test]
648648
fn test_bitvec() {

0 commit comments

Comments
 (0)