title: What is the proper way to use the `cfg!` macro to choose between multiple implementations?
body: <p>I have specified a few features inside <code>Cargo.toml</code>:</p>
  
  <pre><code>[features]
  complex = []
  simple = []
  </code></pre>
  
  <p>When I build my project I use <code>cargo build --features="complex"</code> or <code>simple</code>.</p>
  
  <p>In some functions, I want to return a value based on which feature is used:</p>
  
  <pre><code>fn test() -&gt; u32 {
      let x: u32 = 3;
      if cfg!(feature = "complex") {
          let y: u32 = 2;
          x + y
      }
      if cfg!(feature = "simple") {
          let y: u32 = 1;
          x + y
      }
  }
  </code></pre>
  
  <p>But this doesn't work as it tries to evaluate both expressions. What is the proper way to use the <code>cfg!</code> macro in my case?</p>