File tree Expand file tree Collapse file tree 6 files changed +84
-15
lines changed
Expand file tree Collapse file tree 6 files changed +84
-15
lines changed Original file line number Diff line number Diff line change @@ -33,32 +33,53 @@ jobs:
3333 toolchain : ${{ matrix.rust }}
3434 override : true
3535
36+ - name : Cache
37+ uses : Swatinem/rust-cache@v1
38+
39+ - name : Install cargo-hack
40+ uses : actions-rs/cargo@v1.0.3
41+ with :
42+ command : install
43+ args : cargo-hack
44+
3645 - name : cargo fmt
3746 uses : actions-rs/cargo@v1.0.3
3847 with :
3948 command : fmt
4049 args : --all -- --check
4150
51+ - name : cargo check (feature powerset)
52+ uses : actions-rs/cargo@v1.0.3
53+ with :
54+ command : hack
55+ args : check --feature-powerset --no-dev-deps --optional-deps --workspace
56+
4257 - name : cargo build
4358 uses : actions-rs/cargo@v1.0.3
4459 with :
4560 command : build
46- args : --verbose --all
61+ args : --verbose --all-features
62+
63+ - name : cargo clippy
64+ uses : actions-rs/cargo@v1.0.3
65+ with :
66+ command : clippy
67+ args : --verbose --all-features --all-targets --workspace
4768
4869 - name : cargo test
4970 uses : actions-rs/cargo@v1.0.3
5071 with :
5172 command : test
52- args : --verbose --all
73+ args : --verbose --all-features --workspace
5374
5475 - name : cargo doc
5576 uses : actions-rs/cargo@v1.0.3
5677 with :
5778 command : doc
58- args : --verbose --all
79+ args : --verbose --all-features --workspace
5980
6081 - name : cargo bench
6182 uses : actions-rs/cargo@v1.0.3
6283 with :
6384 command : bench
64- args : --verbose --all -- --test
85+ args : --verbose --all-features --workspace -- --test
Original file line number Diff line number Diff line change @@ -17,20 +17,26 @@ readme = "README.md"
1717edition = " 2021"
1818
1919[dependencies ]
20- fixedbitset = " 0.4"
21- num-traits = " ^0.2.4"
22- rand = " 0.8"
23- succinct = " ^0.5"
24-
25- [dependencies .bytecount ]
26- version = " 0.6"
27- features = [" runtime-dispatch-simd" ]
20+ bytecount = { version = " 0.6" , features = [" runtime-dispatch-simd" ], optional = true }
21+ fixedbitset = { version = " 0.4" , optional = true }
22+ num-traits = { version = " ^0.2.4" , optional = true }
23+ rand = { version = " 0.8" , optional = true }
24+ succinct = { version = " ^0.5" , optional = true }
2825
2926[dev-dependencies ]
3027criterion = " 0.3"
3128rand_chacha = " 0.3"
3229rand_distr = " 0.4"
3330
31+ [features ]
32+ default = [
33+ " bytecount" ,
34+ " fixedbitset" ,
35+ " num-traits" ,
36+ " rand" ,
37+ " succinct" ,
38+ ]
39+
3440[[bench ]]
3541name = " filters"
3642harness = false
Original file line number Diff line number Diff line change 11//! Filters, Approximate Membership Queries (AMQs).
22
3+ #[ cfg( feature = "fixedbitset" ) ]
34pub mod bloomfilter;
5+
46pub mod compat;
7+
8+ #[ cfg( all( feature = "rand" , feature = "succinct" ) ) ]
59pub mod cuckoofilter;
10+
11+ #[ cfg( all( feature = "fixedbitset" , feature = "succinct" ) ) ]
612pub mod quotientfilter;
713
814use std:: fmt:: Debug ;
Original file line number Diff line number Diff line change 1+ #![ allow( dead_code) ]
12use std:: mem;
23
3- use num_traits:: Zero ;
44use succinct:: storage:: BlockType ;
55use succinct:: IntVector ;
66
7+ /// Our own version of `num_traits::Zero` so we don't need to depend on it just for the two types.
8+ pub ( crate ) trait NumZero {
9+ fn create_zero ( ) -> Self ;
10+ }
11+
12+ impl NumZero for usize {
13+ fn create_zero ( ) -> Self {
14+ 0
15+ }
16+ }
17+
18+ impl NumZero for u64 {
19+ fn create_zero ( ) -> Self {
20+ 0
21+ }
22+ }
23+
724/// Quicker all-zero initialization of an IntVector.
825pub ( crate ) fn all_zero_intvector < T > ( element_bits : usize , len : usize ) -> IntVector < T >
926where
10- T : BlockType + Zero ,
27+ T : BlockType + NumZero ,
1128{
1229 let n_blocks = {
1330 let bits = mem:: size_of :: < T > ( )
2340 blocks
2441 }
2542 } ;
26- IntVector :: block_with_fill ( element_bits, n_blocks, T :: zero ( ) )
43+ IntVector :: block_with_fill ( element_bits, n_blocks, T :: create_zero ( ) )
2744}
Original file line number Diff line number Diff line change 1919#![ deny( unsafe_code) ]
2020#![ deny( unused_extern_crates) ]
2121
22+ #[ cfg( feature = "num-traits" ) ]
2223pub use num_traits;
24+
25+ #[ cfg( feature = "rand" ) ]
2326pub use rand;
2427
28+ #[ cfg( feature = "num-traits" ) ]
2529pub mod countminsketch;
30+
2631pub mod filters;
32+
2733pub mod hash_utils;
34+
35+ #[ cfg( feature = "succinct" ) ]
2836mod helpers;
37+
38+ #[ cfg( feature = "bytecount" ) ]
2939pub mod hyperloglog;
40+
41+ #[ cfg( feature = "bytecount" ) ]
3042mod hyperloglog_data;
43+
44+ #[ cfg( feature = "rand" ) ]
3145pub mod reservoirsampling;
46+
47+ #[ cfg( feature = "rand" ) ]
3248pub mod tdigest;
49+
3350pub mod topk;
3451
3552#[ cfg( test) ]
Original file line number Diff line number Diff line change 11//! Top-K, store `k` most frequent data points in stream.
2+ #[ cfg( feature = "num-traits" ) ]
23pub mod cmsheap;
4+
35pub mod lossycounter;
You can’t perform that action at this time.
0 commit comments