From 27eb6b2a2cd3052a02868a95ea03a093725ebf82 Mon Sep 17 00:00:00 2001 From: logaritmisk Date: Sun, 7 Jan 2018 14:52:50 +0100 Subject: [PATCH] More progress. --- src/block.rs | 2 +- src/lib.rs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/block.rs b/src/block.rs index 1ef01cb..3101cf8 100644 --- a/src/block.rs +++ b/src/block.rs @@ -71,7 +71,7 @@ macro_rules! block_impl { fn block(value: Self) -> Self where B: Block { value / B::bits() as Self } #[inline] - fn bit(value: B) -> Self where B: Block { B::biter::(value) as Self } + fn bit(value: B) -> Self where B: Block { Self::from(B::biter::(value)) } #[inline] fn biter(value: Self) -> u8 where B: Block { (value % B::bits() as Self) as u8 } diff --git a/src/lib.rs b/src/lib.rs index ea95ed5..0b1d2fd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -247,6 +247,14 @@ impl<'a, T, B> ops::BitOr<&'a Self> for BitSet where T: Block, B: Block { self } } + +pub struct Iter<'a, T: 'a, B: 'a> { + iter: std::collections::hash_map::Iter<'a, T, B>, + block: T, + bits: B, + bit: B, +} + /* pub struct Iter<'a> { iter: std::collections::hash_map::Iter<'a, u64, u64>,