From 510de59dbd470d9f62a570eb46bfe4bbb10f0988 Mon Sep 17 00:00:00 2001 From: Alona Enraght-Moony Date: Sat, 1 Feb 2025 19:57:59 +0000 Subject: [PATCH] rustdoc-json-types: Document that crate name isn't package name. --- src/rustdoc-json-types/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs index e67e17a73cb73..a92f3ded77466 100644 --- a/src/rustdoc-json-types/lib.rs +++ b/src/rustdoc-json-types/lib.rs @@ -61,6 +61,13 @@ pub struct Crate { #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct ExternalCrate { /// The name of the crate. + /// + /// Note: This is the [*crate* name][crate-name], which may not be the same as the + /// [*package* name][package-name]. For example, for , + /// this field will be `regex_syntax` (which uses an `_`, not a `-`). + /// + /// [crate-name]: https://doc.rust-lang.org/stable/cargo/reference/cargo-targets.html#the-name-field + /// [package-name]: https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-name-field pub name: String, /// The root URL at which the crate's documentation lives. pub html_root_url: Option,