Hacker News new | ask | show | jobs
by swsieber 2372 days ago
I'd personally do this:

  pub enum SearchOption {
      Left,
      Full,
      Beta(SearchOptionBeta),
  }

  #[non_exhaustive]
  pub enum SearchOptionBeta {
      Right
  }
1 comments

Yeah, this is how could be done with this, but also show why is a poor abstraction.

If enums were abled to be extended:

  match e: SearchOptionBeta {
   SearchOptionBeta:: Left, Rigth, Full
  }