We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bdcc46 commit 923bedeCopy full SHA for 923bede
src/lib.rs
@@ -601,7 +601,7 @@ where
601
}
602
603
/// Returns an iterator that yields each set flag
604
- pub fn iter(self) -> impl Iterator<Item = T> {
+ pub fn iter(self) -> impl Iterator<Item = T> + Clone {
605
T::FLAG_LIST
606
.iter()
607
.cloned()
test_suite/common.rs
@@ -87,6 +87,9 @@ fn iterator() {
87
88
for &(bitflag, expected) in tests {
89
assert!(bitflag.iter().zip(expected.iter().cloned()).all(|(a, b)| a == b));
90
+ // If cloned, the iterator will yield the same elements.
91
+ let it = bitflag.iter();
92
+ assert!(it.clone().zip(it).all(|(a, b)| a == b));
93
94
95
0 commit comments