@@ -1142,22 +1142,21 @@ fn fmt_type<'cx>(
1142
1142
// the ugliness comes from inlining across crates where
1143
1143
// everything comes in as a fully resolved QPath (hard to
1144
1144
// look at).
1145
- match href ( trait_. def_id ( ) , cx) {
1146
- Ok ( ( ref url, _, ref path) ) if !f. alternate ( ) => {
1147
- write ! (
1148
- f,
1149
- "<a class=\" associatedtype\" href=\" {url}#{shortty}.{name}\" \
1150
- title=\" type {path}::{name}\" >{name}</a>{args}",
1151
- url = url,
1152
- shortty = ItemType :: AssocType ,
1153
- name = assoc. name,
1154
- path = join_with_double_colon( path) ,
1155
- args = assoc. args. print( cx) ,
1156
- ) ?;
1157
- }
1158
- _ => write ! ( f, "{}{:#}" , assoc. name, assoc. args. print( cx) ) ?,
1159
- }
1160
- Ok ( ( ) )
1145
+ if !f. alternate ( ) && let Ok ( ( url, _, path) ) = href ( trait_. def_id ( ) , cx) {
1146
+ write ! (
1147
+ f,
1148
+ "<a class=\" associatedtype\" href=\" {url}#{shortty}.{name}\" \
1149
+ title=\" type {path}::{name}\" >{name}</a>",
1150
+ shortty = ItemType :: AssocType ,
1151
+ name = assoc. name,
1152
+ path = join_with_double_colon( & path) ,
1153
+ )
1154
+ } else {
1155
+ write ! ( f, "{}" , assoc. name)
1156
+ } ?;
1157
+
1158
+ // Carry `f.alternate()` into this display w/o branching manually.
1159
+ fmt:: Display :: fmt ( & assoc. args . print ( cx) , f)
1161
1160
}
1162
1161
}
1163
1162
}
0 commit comments