-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document
name
and authors
in [package]
- Loading branch information
Showing
1 changed file
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,20 @@ version = "0.1.0" # the current version, obeying semver | |
authors = ["Alice <[email protected]>", "Bob <[email protected]>"] | ||
``` | ||
|
||
All three of these fields are mandatory. | ||
#### The `name` field | ||
|
||
The package name is an identifier used to refer to the package. It is used | ||
when listed as a dependency in another package, and as the default name of | ||
inferred lib and bin targets. | ||
|
||
The name must not be empty, use only [alphanumeric] characters or `-` or `_`. | ||
Note that `cargo new` and `cargo init` impose some additional restrictions on | ||
the package name, such as enforcing that it is a valid Rust identifier and not | ||
a keyword. [crates.io][cratesio] imposes even more restrictions, such as | ||
enforcing only ASCII characters, not a reserved name, not a special Windows | ||
name such as "nul", is not too long, etc. | ||
|
||
[alphanumeric]: https://doc.rust-lang.org/std/primitive.char.html#method.is_alphanumeric | ||
|
||
#### The `version` field | ||
|
||
|
@@ -31,6 +44,15 @@ Versioning](http://semver.org/), so make sure you follow some basic rules: | |
traits, fields, types, functions, methods or anything else. | ||
* Use version numbers with three numeric parts such as 1.0.0 rather than 1.0. | ||
|
||
#### The `authors` field (optional) | ||
|
||
The `authors` field lists people or organizations that are considered the | ||
"authors" of the package. The exact meaning is open to interpretation — it may | ||
list the original or primary authors, current maintainers, or owners of the | ||
package. These names will be listed on the crate's page on | ||
[crates.io][cratesio]. An optional email address may be included within angled | ||
brackets at the end of each author. | ||
|
||
#### The `edition` field (optional) | ||
|
||
You can opt in to a specific Rust Edition for your package with the | ||
|