@@ -2213,20 +2213,6 @@ impl Clean<PathSegment> for hir::PathSegment {
2213
2213
}
2214
2214
}
2215
2215
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
-
2230
2216
impl Clean < String > for ast:: Name {
2231
2217
fn clean ( & self , _: & DocContext ) -> String {
2232
2218
self . to_string ( )
@@ -2681,11 +2667,12 @@ fn name_from_pat(p: &hir::Pat) -> String {
2681
2667
match p. node {
2682
2668
PatKind :: Wild => "_" . to_string ( ) ,
2683
2669
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 ( ) ,
2685
2671
PatKind :: Path ( ..) => panic ! ( "tried to get argument name from qualified PatKind::Path, \
2686
2672
which is not allowed in function arguments") ,
2687
2673
PatKind :: Struct ( ref name, ref fields, etc) => {
2688
- format ! ( "{} {{ {}{} }}" , path_to_string( name) ,
2674
+ format ! ( "{} {{ {}{} }}" ,
2675
+ name,
2689
2676
fields. iter( ) . map( |& Spanned { node: ref fp, .. } |
2690
2677
format!( "{}: {}" , fp. name, name_from_pat( & * fp. pat) ) )
2691
2678
. collect:: <Vec <String >>( ) . join( ", " ) ,
0 commit comments