@@ -72,8 +72,8 @@ pub struct WhereClause<'a>{
72
72
}
73
73
74
74
pub struct HRef < ' a > {
75
- pub did : DefId ,
76
- pub text : & ' a str ,
75
+ did : DefId ,
76
+ text : & ' a str ,
77
77
}
78
78
79
79
impl < ' a > VisSpace < ' a > {
@@ -452,7 +452,7 @@ fn resolved_path(w: &mut fmt::Formatter<'_>, did: DefId, path: &clean::Path,
452
452
}
453
453
}
454
454
if w. alternate ( ) {
455
- write ! ( w, "{:# }{:#}" , HRef :: new ( did , & last. name) , last. args) ?;
455
+ write ! ( w, "{}{:#}" , & last. name, last. args) ?;
456
456
} else {
457
457
let path = if use_absolute {
458
458
match href ( did) {
@@ -538,14 +538,11 @@ impl<'a> HRef<'a> {
538
538
539
539
impl < ' a > fmt:: Display for HRef < ' a > {
540
540
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
541
- match href ( self . did ) {
542
- Some ( ( url, shortty, fqp) ) => if !f. alternate ( ) {
543
- write ! ( f, "<a class=\" {}\" href=\" {}\" title=\" {} {}\" >{}</a>" ,
544
- shortty, url, shortty, fqp. join( "::" ) , self . text)
545
- } else {
546
- write ! ( f, "{}" , self . text)
547
- } ,
548
- _ => write ! ( f, "{}" , self . text) ,
541
+ if let Some ( ( url, short_ty, fqp) ) = href ( self . did ) {
542
+ write ! ( f, r#"<a class="{}" href="{}" title="{} {}">{}</a>"# ,
543
+ short_ty, url, short_ty, fqp. join( "::" ) , self . text)
544
+ } else {
545
+ write ! ( f, "{}" , self . text)
549
546
}
550
547
}
551
548
}
0 commit comments