• Glitchvid@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    4 days ago

    …Which is basically how the OP’s or function also works, it takes several Option<T>s and returns the first valid one (and only that one), it doesn’t operate on boolean logic types — it’s a valid lexical use of or.

    • Asetru@feddit.org
      link
      fedilink
      arrow-up
      1
      ·
      4 days ago

      Absolutely not.

      Mutually exclusive options

      Another classic. Pick one output format: JSON, YAML, or XML. But definitely not two.

      Emphasis mine.

      It takes the input and fails if there is more than one valid one, which decidedly isn’t what’s an “or” in comp sci.