about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAditya Kumar <git@adityais.dev>2024-12-29 07:01:54 +0000
committerAditya Kumar <git@adityais.dev>2025-01-14 06:03:43 +0000
commit2c4aee92fa65e74f23ad7853937db8d2c4bfa6c8 (patch)
tree8c0e396f28810ed7e8019a3bbf0f7f378082716a /src
parent480eec0692f003c9d8bd477ee867f2f66643bc04 (diff)
Made `Path::name` only have item name rather than full name
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/json/conversions.rs2
-rw-r--r--src/rustdoc-json-types/lib.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs
index 7f072aa7e2f..093f8eff839 100644
--- a/src/librustdoc/json/conversions.rs
+++ b/src/librustdoc/json/conversions.rs
@@ -620,7 +620,7 @@ impl FromClean<clean::Type> for Type {
 impl FromClean<clean::Path> for Path {
     fn from_clean(path: clean::Path, renderer: &JsonRenderer<'_>) -> Path {
         Path {
-            name: path.whole_name(),
+            name: path.last_opt().map_or(String::from(""), |s| String::from(s.as_str())),
             id: renderer.id_from_item_default(path.def_id().into()),
             args: path.segments.last().map(|args| Box::new(args.clone().args.into_json(renderer))),
         }
diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs
index 84b33e3d860..5a99977ded5 100644
--- a/src/rustdoc-json-types/lib.rs
+++ b/src/rustdoc-json-types/lib.rs
@@ -30,7 +30,7 @@ pub type FxHashMap<K, V> = HashMap<K, V>; // re-export for use in src/librustdoc
 /// This integer is incremented with every breaking change to the API,
 /// and is returned along with the JSON blob as [`Crate::format_version`].
 /// Consuming code should assert that this value matches the format version(s) that it supports.
-pub const FORMAT_VERSION: u32 = 37;
+pub const FORMAT_VERSION: u32 = 38;
 
 /// The root of the emitted JSON blob.
 ///