Rust's language ergonomics initiative
I am not sure if this directly applies to your post, but it came to mind when I read the section about `extern crate`.  It seems like the Cargo system is relied upon by almost all Rust users, and I am not sure if the following is an ergonomics problem or a lack of understanding on my part.<p>A couple months ago I was exploring Rust&#x27;s web server capabilities after seeing the &quot;Are we <i>web</i> yet?&quot; page.  I decided to try out the `iron` package.[0]<p>I was quickly able to serve some basic content, but I wanted to add some headers to the response.<p>I was able to `use iron::headers::Allow` to add an Allow header.[1]<p>Next, I wanted a Link header.  Link wasn&#x27;t available but I could get around that by defining a custom header with the `header!` macro.  Unfortunately, I couldn&#x27;t figure out how to get the `header!` macro for custom headers without `#[macro_use] extern crate hyper` and adding `hyper` to the Cargo.toml file.[2]<p>Then I wanted a `Vary` header.  I was able to get that in with `use iron::headers::Vary`, but I couldn&#x27;t actually create one yet! In order to create my `Vary::Items` header, I needed to also `use unicase::UniCase` and add `unicase` to my Cargo.toml.[3][4]<p>So within an hour or so of starting the project, my explicitly listed dependencies had grown from just `iron` to include two additional dependencies.  The iron package already relies upon hyper which already relies upon unicase.<p>Here are some questions I am still left with. Would love any responses.<p>Is it possible for me to use the pieces described above without explicitly listing these crates? If not, why do I need to declare hyper as a dependency when iron is already using it? Perhaps I don&#x27;t need to, and I was just unable to figure out how to get the `header!` macro from iron directly.  My initial expectation was that iron would either wrap or expose every part of hyper that I might need.  The same goes for hyper not allowing me to just use the same unicase it relies upon.<p>How am I supposed to get the correct version of hyper and unicase to match with the ones that my version of iron was sent with?  Do I have to go look them up? Can use the latest version of `hyper` even if `iron` is a few versions behind? What version should I be specifying?<p>[0]: <a href="http:&#x2F;&#x2F;ironframework.io&#x2F;doc&#x2F;iron&#x2F;" rel="nofollow">http:&#x2F;&#x2F;ironframework.io&#x2F;doc&#x2F;iron&#x2F;</a><p>[1]: <a href="http:&#x2F;&#x2F;ironframework.io&#x2F;doc&#x2F;iron&#x2F;headers&#x2F;struct.Allow.html" rel="nofollow">http:&#x2F;&#x2F;ironframework.io&#x2F;doc&#x2F;iron&#x2F;headers&#x2F;struct.Allow.html</a><p>[2]: <a href="https:&#x2F;&#x2F;hyper.rs&#x2F;hyper&#x2F;v0.9.9&#x2F;hyper&#x2F;macro.header!.html" rel="nofollow">https:&#x2F;&#x2F;hyper.rs&#x2F;hyper&#x2F;v0.9.9&#x2F;hyper&#x2F;macro.header!.html</a><p>[3]: <a href="http:&#x2F;&#x2F;ironframework.io&#x2F;doc&#x2F;iron&#x2F;headers&#x2F;enum.Vary.html" rel="nofollow">http:&#x2F;&#x2F;ironframework.io&#x2F;doc&#x2F;iron&#x2F;headers&#x2F;enum.Vary.html</a><p>[4]: <a href="http:&#x2F;&#x2F;ironframework.io&#x2F;doc&#x2F;unicase&#x2F;struct.UniCase.html" rel="nofollow">http:&#x2F;&#x2F;ironframework.io&#x2F;doc&#x2F;unicase&#x2F;struct.UniCase.html</a>