@@ -72,8 +72,8 @@ pub struct WhereClause<'a>{
7272}
7373
7474pub struct HRef < ' a > {
75- pub did : DefId ,
76- pub text : & ' a str ,
75+ did : DefId ,
76+ text : & ' a str ,
7777}
7878
7979impl < ' a > VisSpace < ' a > {
@@ -452,7 +452,7 @@ fn resolved_path(w: &mut fmt::Formatter<'_>, did: DefId, path: &clean::Path,
452452 }
453453 }
454454 if w. alternate ( ) {
455- write ! ( w, "{:# }{:#}" , HRef :: new ( did , & last. name) , last. args) ?;
455+ write ! ( w, "{}{:#}" , & last. name, last. args) ?;
456456 } else {
457457 let path = if use_absolute {
458458 match href ( did) {
@@ -538,14 +538,11 @@ impl<'a> HRef<'a> {
538538
539539impl < ' a > fmt:: Display for HRef < ' a > {
540540 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)
549546 }
550547 }
551548}
0 commit comments