Clippy.
This commit is contained in:
@@ -21,7 +21,7 @@ fn contains(data: &[u64]) {
|
|||||||
let set = BitSet::new();
|
let set = BitSet::new();
|
||||||
|
|
||||||
for v in data {
|
for v in data {
|
||||||
set.contains(v);
|
set.contains(*v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
src/lib.rs
12
src/lib.rs
@@ -25,7 +25,7 @@ type Storage = HashMap<u64, Block, BitBuildHasher>;
|
|||||||
pub type BitHashMap<V> = HashMap<u64, V, BitBuildHasher>;
|
pub type BitHashMap<V> = HashMap<u64, V, BitBuildHasher>;
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn block_bit(x: &u64, d: &u64) -> (u64, u64) {
|
fn block_bit(x: u64, d: u64) -> (u64, u64) {
|
||||||
(x / d, x % d)
|
(x / d, x % d)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,8 +91,8 @@ impl BitSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn contains(&self, value: &u64) -> bool {
|
pub fn contains(&self, value: u64) -> bool {
|
||||||
let (block, bit) = block_bit(value, &BITS);
|
let (block, bit) = block_bit(value, BITS);
|
||||||
|
|
||||||
match self.blocks.get(&block) {
|
match self.blocks.get(&block) {
|
||||||
Some(block) => (block & (1 << bit)) != 0,
|
Some(block) => (block & (1 << bit)) != 0,
|
||||||
@@ -121,7 +121,7 @@ impl BitSet {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn insert(&mut self, value: u64) -> bool {
|
pub fn insert(&mut self, value: u64) -> bool {
|
||||||
let (block, bit) = block_bit(&value, &BITS);
|
let (block, bit) = block_bit(value, BITS);
|
||||||
let block = self.blocks.entry(block).or_insert(0);
|
let block = self.blocks.entry(block).or_insert(0);
|
||||||
|
|
||||||
let n = 1 << bit;
|
let n = 1 << bit;
|
||||||
@@ -137,8 +137,8 @@ impl BitSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn remove(&mut self, value: &u64) -> bool {
|
pub fn remove(&mut self, value: u64) -> bool {
|
||||||
let (block, bit) = block_bit(value, &BITS);
|
let (block, bit) = block_bit(value, BITS);
|
||||||
let block = self.blocks.entry(block).or_insert(0);
|
let block = self.blocks.entry(block).or_insert(0);
|
||||||
|
|
||||||
let n = 1 << bit;
|
let n = 1 << bit;
|
||||||
|
|||||||
Reference in New Issue
Block a user