MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / iter

Method iter

splashsurf_lib/src/traits.rs:29–41  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

27 }
28
29 pub fn iter(self) -> impl Iterator<Item = I> {
30 let end = self.end;
31 let mut counter = self.start;
32 std::iter::from_fn(move || {
33 let current = counter;
34 if current < end {
35 counter += I::one();
36 Some(current)
37 } else {
38 None
39 }
40 })
41 }
42}
43
44/// Trait that has to be implemented for types to be used as background grid cell indices in the context of the library

Callers 1

try_convertMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected