title: Compare enums only by variant, not value
body: <p>I have an enum with the following structure:</p>
  
  <pre><code>enum Expression {
      Add(Add),
      Mul(Mul),
      Var(Var),
      Coeff(Coeff)
  }
  </code></pre>
  
  <p>where the 'members' of each variant are structs.</p>
  
  <p>Now I want to compare if two enums have the same variant. So if I have</p>
  
  <pre><code>let a = Expression::Add({something});
  let b = Expression::Add({somethingelse});
  </code></pre>
  
  <p><code>cmpvariant(a, b)</code> should be <code>true</code>. I can imagine a simple double <code>match</code> code that goes through all the options for both enum instances. However, I am looking for a fancier solution, if it exists. If not, is there overhead for the double match? I imagine that internally I am just comparing two ints (ideally).</p>