Skip to content

Commit ee65dc2

Browse files
committed
Made Path::name only have item name rather than full name
1 parent 480eec0 commit ee65dc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustdoc/json/conversions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ impl FromClean<clean::Type> for Type {
620620
impl FromClean<clean::Path> for Path {
621621
fn from_clean(path: clean::Path, renderer: &JsonRenderer<'_>) -> Path {
622622
Path {
623-
name: path.whole_name(),
623+
name: path.last_opt().map_or(String::from(""), |s| String::from(s.as_str())),
624624
id: renderer.id_from_item_default(path.def_id().into()),
625625
args: path.segments.last().map(|args| Box::new(args.clone().args.into_json(renderer))),
626626
}

0 commit comments

Comments
 (0)