diff options
| author | Alex Saveau <saveau.alexandre@gmail.com> | 2023-05-11 05:56:17 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-11 14:56:17 +0200 |
| commit | e472b0347f84f39edf4655d39f8b5484870d0a76 (patch) | |
| tree | d722a59d87a2e438b06ed88eab2a313d2e4bfd13 /src/geom | |
| parent | 27771bc329ab23cc551637fb3feac7b5689e64c7 (diff) | |
Alternate between right/left alignment in equations (#936)
Diffstat (limited to 'src/geom')
| -rw-r--r-- | src/geom/align.rs | 19 |
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 + } +} |
