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;
39
39
use std:: hash:: { Hash , Hasher } ;
40
40
use std:: default:: Default ;
41
41
use std:: { mem, slice, vec} ;
42
- use std:: iter:: { FromIterator , once } ;
42
+ use std:: iter:: FromIterator ;
43
43
use std:: rc:: Rc ;
44
44
use std:: cell:: RefCell ;
45
45
use std:: sync:: Arc ;
@@ -4398,24 +4398,6 @@ impl Clean<TypeBindingKind> for hir::TypeBindingKind {
4398
4398
}
4399
4399
}
4400
4400
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
-
4419
4401
pub fn enter_impl_trait < F , R > ( cx : & DocContext < ' _ > , f : F ) -> R
4420
4402
where
4421
4403
F : FnOnce ( ) -> R ,
Original file line number Diff line number Diff line change @@ -15,9 +15,26 @@ use syntax_pos::{self, Span};
15
15
use std:: mem;
16
16
17
17
use crate :: core;
18
- use crate :: clean:: { self , AttributesExt , NestedAttributesExt , def_id_to_path } ;
18
+ use crate :: clean:: { self , AttributesExt , NestedAttributesExt } ;
19
19
use crate :: doctree:: * ;
20
20
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
+ }
21
38
22
39
// Also, is there some reason that this doesn't use the 'visit'
23
40
// framework from syntax?.
You can’t perform that action at this time.
0 commit comments