MCPcopy Create free account
hub / github.com/bitflags/bitflags / next

Method next

src/iter.rs:41–58  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

39 type Item = B;
40
41 fn next(&mut self) -> Option<Self::Item> {
42 match self.inner.next() {
43 Some((_, flag)) => Some(flag),
44 None if !self.done => {
45 self.done = true;
46
47 // After iterating through valid names, if there are any bits left over
48 // then return one final value that includes them. This makes `into_iter`
49 // and `from_iter` roundtrip
50 if !self.inner.remaining().is_empty() {
51 Some(B::from_bits_retain(self.inner.remaining.bits()))
52 } else {
53 None
54 }
55 }
56 None => None,
57 }
58 }
59}
60
61/**

Callers

nothing calls this directly

Calls 9

is_emptyMethod · 0.80
remainingMethod · 0.80
nameMethod · 0.80
valueMethod · 0.80
containsMethod · 0.80
intersectsMethod · 0.80
removeMethod · 0.80
is_namedMethod · 0.80
bitsMethod · 0.45

Tested by

no test coverage detected