summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/geom/align.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/geom/align.rs b/src/geom/align.rs
index 239a6e70..69f32bee 100644
--- a/src/geom/align.rs
+++ b/src/geom/align.rs
@@ -183,3 +183,22 @@ impl Fold for GenAlign {
self
}
}
+
+#[derive(Copy, Clone, Eq, PartialEq, Debug)]
+pub enum LeftRightAlternator {
+ Left,
+ Right,
+}
+
+impl Iterator for LeftRightAlternator {
+ type Item = LeftRightAlternator;
+
+ fn next(&mut self) -> Option<Self::Item> {
+ let r = Some(*self);
+ match self {
+ Self::Left => *self = Self::Right,
+ Self::Right => *self = Self::Left,
+ }
+ r
+ }
+}