title: Should a reference to an enum be dereferenced before it is matched?
body: <p>As a newcomer to Rust, I've stumbled upon two apparently valid ways of running a <code>match</code> on a reference type.</p>
  
  <p>I've defined an enum:</p>
  
  <pre><code>enum Color {
      Red,
      Yellow,
      Green,
      Teal,
      Blue,
      Purple,
  }
  </code></pre>
  
  <p>I want to implement a function that works on a <code>&amp;self</code> reference of an instance of this enum.</p>
  
  <p>I can see two ways to write such a function:</p>
  
  <pre><code>impl Color {
      // Approach #1: Match the reference, using references in each pattern
      fn contains_red(&amp;self) -&gt; bool {
          match self {
              &amp;Color::Red =&gt; true,
              &amp;Color::Yellow =&gt; true,
              &amp;Color::Purple =&gt; true,
              _ =&gt; false,
          }
      }
  
      // Approach #2: Dereference &amp;self and match the patterns directly
      fn contains_blue(&amp;self) -&gt; bool {
          match *self {
              Color::Blue =&gt; true,
              Color::Teal =&gt; true,
              Color::Purple =&gt; true,
              _ =&gt; false,
          }
      }
  }
  </code></pre>
  
  <p>I expected that dereferencing <code>&amp;self</code> would be counted as a move, and would cause errors if I called <code>color.contains_blue()</code> on the same instance twice in a row, but this doesn't seem to be the case.</p>
  
  <p>Are these approaches functionally identical? Would one of them break down if I were matching more complex objects? </p>