@@ -284,7 +284,7 @@ pub struct Cache {
284
284
/// found on that implementation.
285
285
pub impls : FxHashMap < DefId , Vec < Impl > > ,
286
286
287
- /// Maintains a mapping of local crate `NodeId `s to the fully qualified name
287
+ /// Maintains a mapping of local crate `DefId `s to the fully qualified name
288
288
/// and "short type description" of that node. This is used when generating
289
289
/// URLs when a type is being linked to. External paths are not located in
290
290
/// this map because the `External` type itself has all the information
@@ -702,7 +702,7 @@ pub fn run(mut krate: clean::Crate,
702
702
703
703
/// Builds the search index from the collected metadata
704
704
fn build_index ( krate : & clean:: Crate , cache : & mut Cache ) -> String {
705
- let mut nodeid_to_pathid = FxHashMap :: default ( ) ;
705
+ let mut defid_to_pathid = FxHashMap :: default ( ) ;
706
706
let mut crate_items = Vec :: with_capacity ( cache. search_index . len ( ) ) ;
707
707
let mut crate_paths = Vec :: < Json > :: new ( ) ;
708
708
@@ -726,21 +726,21 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
726
726
}
727
727
}
728
728
729
- // Reduce `NodeId ` in paths into smaller sequential numbers,
729
+ // Reduce `DefId ` in paths into smaller sequential numbers,
730
730
// and prune the paths that do not appear in the index.
731
731
let mut lastpath = String :: new ( ) ;
732
732
let mut lastpathid = 0usize ;
733
733
734
734
for item in search_index {
735
- item. parent_idx = item. parent . map ( |nodeid | {
736
- if nodeid_to_pathid . contains_key ( & nodeid ) {
737
- * nodeid_to_pathid . get ( & nodeid ) . unwrap ( )
735
+ item. parent_idx = item. parent . map ( |defid | {
736
+ if defid_to_pathid . contains_key ( & defid ) {
737
+ * defid_to_pathid . get ( & defid ) . unwrap ( )
738
738
} else {
739
739
let pathid = lastpathid;
740
- nodeid_to_pathid . insert ( nodeid , pathid) ;
740
+ defid_to_pathid . insert ( defid , pathid) ;
741
741
lastpathid += 1 ;
742
742
743
- let & ( ref fqp, short) = paths. get ( & nodeid ) . unwrap ( ) ;
743
+ let & ( ref fqp, short) = paths. get ( & defid ) . unwrap ( ) ;
744
744
crate_paths. push ( ( ( short as usize ) , fqp. last ( ) . unwrap ( ) . clone ( ) ) . to_json ( ) ) ;
745
745
pathid
746
746
}
0 commit comments