File tree Expand file tree Collapse file tree 2 files changed +19
-20
lines changed Expand file tree Collapse file tree 2 files changed +19
-20
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ use std::fmt;
3939use std:: hash:: { Hash , Hasher } ;
4040use std:: default:: Default ;
4141use std:: { mem, slice, vec} ;
42- use std:: iter:: { FromIterator , once } ;
42+ use std:: iter:: FromIterator ;
4343use std:: rc:: Rc ;
4444use std:: cell:: RefCell ;
4545use std:: sync:: Arc ;
@@ -4398,24 +4398,6 @@ impl Clean<TypeBindingKind> for hir::TypeBindingKind {
43984398 }
43994399}
44004400
4401- pub fn def_id_to_path (
4402- cx : & DocContext < ' _ > ,
4403- did : DefId ,
4404- name : Option < String >
4405- ) -> Vec < String > {
4406- let crate_name = name. unwrap_or_else ( || cx. tcx . crate_name ( did. krate ) . to_string ( ) ) ;
4407- let relative = cx. tcx . def_path ( did) . data . into_iter ( ) . filter_map ( |elem| {
4408- // extern blocks have an empty name
4409- let s = elem. data . to_string ( ) ;
4410- if !s. is_empty ( ) {
4411- Some ( s)
4412- } else {
4413- None
4414- }
4415- } ) ;
4416- once ( crate_name) . chain ( relative) . collect ( )
4417- }
4418-
44194401pub fn enter_impl_trait < F , R > ( cx : & DocContext < ' _ > , f : F ) -> R
44204402where
44214403 F : FnOnce ( ) -> R ,
Original file line number Diff line number Diff line change @@ -15,9 +15,26 @@ use syntax_pos::{self, Span};
1515use std:: mem;
1616
1717use crate :: core;
18- use crate :: clean:: { self , AttributesExt , NestedAttributesExt , def_id_to_path } ;
18+ use crate :: clean:: { self , AttributesExt , NestedAttributesExt } ;
1919use crate :: doctree:: * ;
2020
21+ fn def_id_to_path (
22+ cx : & core:: DocContext < ' _ > ,
23+ did : DefId ,
24+ name : Option < String >
25+ ) -> Vec < String > {
26+ let crate_name = name. unwrap_or_else ( || cx. tcx . crate_name ( did. krate ) . to_string ( ) ) ;
27+ let relative = cx. tcx . def_path ( did) . data . into_iter ( ) . filter_map ( |elem| {
28+ // extern blocks have an empty name
29+ let s = elem. data . to_string ( ) ;
30+ if !s. is_empty ( ) {
31+ Some ( s)
32+ } else {
33+ None
34+ }
35+ } ) ;
36+ std:: iter:: once ( crate_name) . chain ( relative) . collect ( )
37+ }
2138
2239// Also, is there some reason that this doesn't use the 'visit'
2340// framework from syntax?.
You can’t perform that action at this time.
0 commit comments