xor in header.rs does not actually compute the exclusive or of a and b. Instead it checks that a and b are either both true or both false, which is equivalent to a == b. I don't understand what decode does well enough to know if this is the intended behavior or not, but either the name or the implementation is currently wrong. If you do actually need xor there's the ^ operator and the BitXor trait.
xorin header.rs does not actually compute the exclusive or ofaandb. Instead it checks thataandbare either both true or both false, which is equivalent toa == b. I don't understand whatdecodedoes well enough to know if this is the intended behavior or not, but either the name or the implementation is currently wrong. If you do actually needxorthere's the^operator and theBitXortrait.