you are viewing a single comment's thread
view the rest of the comments
[–] 18 points 11 months ago (2 children)

The or() combinator means exactly one succeeds.

Using "or" to define a function that does "xor"... Did that guy never hear about formal logic? That's, like, first or second semester stuff...

Here's the thing: I don't have a CS degree.

sigh

  • source
  • hideshow 4 child comments
  • [+] 1 point 11 months ago* (last edited 11 months ago) (1 child)
  • [–] 1 point 11 months ago* (1 child)

    The result type in rust does not return a true/false but a type. More importantly though, it doesn't return err if both values are set but simply returns the first value:

    So... It's not only not mapping your input to truth values, it also behaves more like I'd expect an "or" to behave, which is not "xor" or, if there's more than two inputs, "exactly one", but succeeding if any input is set.

  • source
  • parent
  • hideshow 2 child comments