title: Similar but distinct match clauses
body: <p>Let's say I have an <code>enum</code> with a few variants:</p>
  
  <pre><code>#[derive(Copy,Clone)]
  enum Foo {
      Left(isize),
      Right(isize),
      Other,
      //...
  }
  </code></pre>
  
  <p>And I want to pattern match on this, with very similar but not identical treatment of <code>Left</code> and <code>Right</code>.</p>
  
  <p>I've ended up with:</p>
  
  <pre><code>match foo {
       Left(i) | Right(i) =&gt; {
            let i2 = match foo {
                 Left(_) =&gt; -i,
                 Right(_) =&gt; i,
                 _  =&gt; unreachable!(),
            };
            move_sideways(i2);
            // non-trivial code, ie not a simple function call
       },
       Other =&gt; { ... }
  }
  </code></pre>
  
  <p>Which isn't very satisfactory, and relies on not consuming <code>foo</code> the first time.  Is there a good idiom I'm missing to avoid re-matching or duplicating the rule?</p>