title: Is there a better way access a same-type enum value than a match?
body: <p>Is there a better way to access the contents of an Enum that in the various cases shares the same variable type?<br />
  At the moment I have solved it this way:</p>
  <pre class="lang-rust prettyprint-override"><code>enum Token&lt;'a&gt; {
      Word(&amp;'a str),
      Reserved(&amp;'a str),
      Whitespace(&amp;'a str),
  }
  
  impl&lt;'a&gt; ToString for Token&lt;'a&gt; {
      fn to_string(&amp;self) -&gt; String {
          match self {
              Self::Word(str) | Self::Reserved(str) | Self::Whitespace(str) =&gt; str.to_string(),
          }
      }
  }
  </code></pre>