Clarify semver paragraphs a bit

This commit is contained in:
Carol (Nichols || Goulding) 2016-07-12 14:42:09 -04:00
parent 0cf529ac69
commit 7e85e67d11

View File

@ -353,18 +353,20 @@ rand = "0.3.14"
```
The `[dependencies]` section of `Cargo.toml` is like the `[package]` section:
everything that follows it is part of it, until the next section starts.
Cargo uses the dependencies section to know what dependencies on external
crates you have, and what versions you require. In this case, weve specified
version `0.3.14`, which Cargo understands to be any release thats compatible
with this specific version. Cargo understands [Semantic Versioning][semver],
which is a standard for writing versio numbers. A bare number like above is
actually shorthand for `^0.3.14`, meaning "anything compatible with 0.3.14".
If we wanted to use only `0.3.14` exactly, we could say `rand = "=0.3.14"`
(note the equal sign within the version string). And if we wanted to use
whatever the latest version currently is, we could use `*`. We could also use a
range of versions. [Cargos documentation][cargodoc] contains more details
about the different ways to specify dependencies.
everything that follows the section heading is part of that section, until
another section starts. Cargo uses the dependencies section to know what
dependencies on external crates you have and what versions of those crates you
require. In this case, weve specified the `rand` crate with the semantic
version specifier `0.3.14`.
Cargo understands [Semantic Versioning][semver], which is a standard for
writing version numbers. A bare number like above is actually shorthand for
`^0.3.14`, which means "any version that has a public API compatible with
version 0.3.14". If we wanted to use only `0.3.14` exactly, we could say `rand
= "=0.3.14"` (note the equal sign within the version string). And if we wanted
to use whatever the latest version currently is, we could use `*`. [Cargos
documentation][cargodoc] contains more details and other ways to specify
dependencies.
[semver]: http://semver.org
[cargodoc]: http://doc.crates.io/crates-io.html