[dependencies.iron]
version = "0.2.*"
[dependencies.bodyparser]
git = "https://github.com/iron/body-parser.git"
[dependencies.redis]
git = "https://github.com/mitsuhiko/redis-rs.git"
[dependencies]
router = "*"
rustc-serialize = "*"
plugin = "*"
rand = "*"
toml = "*"
rust-crypto = "^0.2"
hyper = "*"
r2fa = "*"
urlencoded = "*"
regex = "*"
[dependencies.mysql]
default-features = false
features = ["socket"]
And soon here will be added "rusoto". [dependencies.redis] git = ...
is the same as [dependencies] redis = { git = ... }
This will let you have just one [dependencies] block, which is a bit nicer looking. I've been changing examples to use it instead of that older style; they're equivalent if you prefer it though.I'd also note that while theoretically restricting versions works, in practice having multiple versions of a single crate within a rust project often leads to build failures due to crate A having a public API that uses types from crate B, and crate C using both, but not getting the same version of B that A got. This leads to type errors at build time.
> I'd also note that while theoretically restricting versions works, in practice having multiple versions of a single crate within a rust project often leads to build failures due to crate A having a public API that uses types from crate B, and crate C using both, but not getting the same version of B that A got. This leads to type errors at build time.
This is a problem, yes, but focusing on it by itself is somewhat of a red-herring: if A doesn't restrict B's version there's no guarantee that A compiles against whatever version of B that happens to be chosen, i.e. you don't even get to the point where there could be problematic interactions.
In any case, there has been serious discussion about how cargo can solve the problem of crates exposing other crates in their API, and the current proposed solution is to make cargo more strict about allowing multiple versions of such crates. #2064 is the relevant issue.