I wonder if a more idomatic Rust way of doing this would be an enum like
enum NthValue {
First,
Last,
Nth(u32)
}
And then in NthValueAccumulator::scan you would have something like
match self.n {
NthValue::First|NthValue::Nth(1) => {...}
Nth::Last => {..}
}
There is nothing wrong with the special value approach either -- I just figured I would point it out
Originally posted by @alamb in #403 (comment)