@@ -9,10 +9,10 @@ use rustc_data_structures::fx::FxHashMap;
9
9
use rustc_hir:: def:: DefKind ;
10
10
use rustc_hir:: def_id:: DefId ;
11
11
use rustc_span:: { Symbol , sym} ;
12
- use rustdoc_json_types:: { self as types, Id } ; // FIXME: Consistant.
12
+ use rustdoc_json_types as types;
13
13
14
14
use super :: JsonRenderer ;
15
- use crate :: clean:: { self , ItemId } ;
15
+ use crate :: clean;
16
16
17
17
pub ( super ) type IdInterner = FxHashMap < FullItemId , types:: Id > ;
18
18
@@ -66,20 +66,20 @@ pub(super) struct FullItemId {
66
66
}
67
67
68
68
impl JsonRenderer < ' _ > {
69
- pub ( crate ) fn id_from_item_default ( & self , item_id : ItemId ) -> Id {
69
+ pub ( crate ) fn id_from_item_default ( & self , item_id : clean :: ItemId ) -> types :: Id {
70
70
self . id_from_item_inner ( item_id, None , None )
71
71
}
72
72
73
73
fn id_from_item_inner (
74
74
& self ,
75
- item_id : ItemId ,
75
+ item_id : clean :: ItemId ,
76
76
name : Option < Symbol > ,
77
77
imported_id : Option < DefId > ,
78
- ) -> Id {
78
+ ) -> types :: Id {
79
79
let ( def_id, mut extra_id) = match item_id {
80
- ItemId :: DefId ( did) => ( did, None ) ,
81
- ItemId :: Blanket { for_, impl_id } => ( for_, Some ( impl_id) ) ,
82
- ItemId :: Auto { for_, trait_ } => ( for_, Some ( trait_) ) ,
80
+ clean :: ItemId :: DefId ( did) => ( did, None ) ,
81
+ clean :: ItemId :: Blanket { for_, impl_id } => ( for_, Some ( impl_id) ) ,
82
+ clean :: ItemId :: Auto { for_, trait_ } => ( for_, Some ( trait_) ) ,
83
83
} ;
84
84
85
85
let name = match name {
@@ -112,10 +112,10 @@ impl JsonRenderer<'_> {
112
112
let len = interner. len ( ) ;
113
113
* interner
114
114
. entry ( key)
115
- . or_insert_with ( || Id ( len. try_into ( ) . expect ( "too many items in a crate" ) ) )
115
+ . or_insert_with ( || types :: Id ( len. try_into ( ) . expect ( "too many items in a crate" ) ) )
116
116
}
117
117
118
- pub ( crate ) fn id_from_item ( & self , item : & clean:: Item ) -> Id {
118
+ pub ( crate ) fn id_from_item ( & self , item : & clean:: Item ) -> types :: Id {
119
119
match item. kind {
120
120
clean:: ItemKind :: ImportItem ( ref import) => {
121
121
let imported_id = import. source . did ;
0 commit comments