@@ -2213,20 +2213,6 @@ impl Clean<PathSegment> for hir::PathSegment {
22132213 }
22142214}
22152215
2216- fn path_to_string ( p : & hir:: Path ) -> String {
2217- let mut s = String :: new ( ) ;
2218- let mut first = true ;
2219- for i in p. segments . iter ( ) . map ( |x| x. name . as_str ( ) ) {
2220- if !first || p. global {
2221- s. push_str ( "::" ) ;
2222- } else {
2223- first = false ;
2224- }
2225- s. push_str ( & i) ;
2226- }
2227- s
2228- }
2229-
22302216impl Clean < String > for ast:: Name {
22312217 fn clean ( & self , _: & DocContext ) -> String {
22322218 self . to_string ( )
@@ -2681,11 +2667,12 @@ fn name_from_pat(p: &hir::Pat) -> String {
26812667 match p. node {
26822668 PatKind :: Wild => "_" . to_string ( ) ,
26832669 PatKind :: Binding ( _, ref p, _) => p. node . to_string ( ) ,
2684- PatKind :: TupleStruct ( ref p, ..) | PatKind :: Path ( None , ref p) => path_to_string ( p ) ,
2670+ PatKind :: TupleStruct ( ref p, ..) | PatKind :: Path ( None , ref p) => p . to_string ( ) ,
26852671 PatKind :: Path ( ..) => panic ! ( "tried to get argument name from qualified PatKind::Path, \
26862672 which is not allowed in function arguments") ,
26872673 PatKind :: Struct ( ref name, ref fields, etc) => {
2688- format ! ( "{} {{ {}{} }}" , path_to_string( name) ,
2674+ format ! ( "{} {{ {}{} }}" ,
2675+ name,
26892676 fields. iter( ) . map( |& Spanned { node: ref fp, .. } |
26902677 format!( "{}: {}" , fp. name, name_from_pat( & * fp. pat) ) )
26912678 . collect:: <Vec <String >>( ) . join( ", " ) ,
0 commit comments