From 4083e3841ece594ee45709bb53d0545dd9102328 Mon Sep 17 00:00:00 2001 From: Michal 'vorner' Vaner Date: Wed, 4 Nov 2020 09:09:18 +0100 Subject: [PATCH] Additional traits for Iter Most importantly, Clone, which is generally useful (to pass it to somewhere and iterate over it multiple times, but also for reverse dependencies, see https://github.com/bodil/im-rs/issues/134). Piggy-backing Debug when at it, because, why not. *Not* implementing Copy, as that could lead to footguns (iterators forking by accident would do confusing things). --- src/bitmap.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bitmap.rs b/src/bitmap.rs index 483ca14..684641b 100644 --- a/src/bitmap.rs +++ b/src/bitmap.rs @@ -284,6 +284,7 @@ impl Into<[u128; 8]> for Bitmap { /// let true_indices: Vec = bitmap.into_iter().collect(); /// assert_eq!(vec![3, 5, 8], true_indices); /// ``` +#[derive(Clone, Debug)] pub struct Iter<'a, Size: Bits> { index: usize, data: &'a Bitmap,