Skip to content

Commit 510de59

Browse files
committed
rustdoc-json-types: Document that crate name isn't package name.
1 parent 9e48dfe commit 510de59

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/rustdoc-json-types/lib.rs

+7
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ pub struct Crate {
6161
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
6262
pub struct ExternalCrate {
6363
/// The name of the crate.
64+
///
65+
/// Note: This is the [*crate* name][crate-name], which may not be the same as the
66+
/// [*package* name][package-name]. For example, for <https://crates.io/crates/regex-syntax>,
67+
/// this field will be `regex_syntax` (which uses an `_`, not a `-`).
68+
///
69+
/// [crate-name]: https://doc.rust-lang.org/stable/cargo/reference/cargo-targets.html#the-name-field
70+
/// [package-name]: https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-name-field
6471
pub name: String,
6572
/// The root URL at which the crate's documentation lives.
6673
pub html_root_url: Option<String>,

0 commit comments

Comments
 (0)