title: How to have an optional dependency enable another optional dependency rust
body: <p>I am creating a library in rust and I have different features which the user can enable via optional dependencies. I want it so if the dependency <code>diesel</code> is enabled than <code>diesel-derive-enum</code> should also be enabled.</p>
  <pre><code>[dependencies]
  diesel = {version = &quot;1.4.6&quot;, optional = true, features = [&quot;postgres&quot;, &quot;chrono&quot;]}
  diesel-derive-enum = {version = &quot;1.1.1&quot;, optional = true, features = [&quot;postgres&quot;]}
  </code></pre>