Skip to content

use a more rust idiomatic way of handling nth_value #448

Description

@jimexist

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions