@@ -44,7 +44,7 @@ pub fn check(cx: &LateContext<'_>, doc: &str, range: Range<usize>, fragments: &F
44
44
"looks like a footnote ref, but has no matching footnote" ,
45
45
|diag| {
46
46
if last_doc_attr. is_doc_comment ( ) {
47
- let ( pfx , sfx ) = match ( last_doc_attr_comment_kind, last_doc_attr. style ( ) ) {
47
+ let ( to_add , terminator ) = match ( last_doc_attr_comment_kind, last_doc_attr. style ( ) ) {
48
48
( CommentKind :: Line , AttrStyle :: Outer ) => ( "\n ///\n /// " , "" ) ,
49
49
( CommentKind :: Line , AttrStyle :: Inner ) => ( "\n //!\n //! " , "" ) ,
50
50
( CommentKind :: Block , AttrStyle :: Outer ) => ( "\n /** " , " */" ) ,
@@ -53,7 +53,10 @@ pub fn check(cx: &LateContext<'_>, doc: &str, range: Range<usize>, fragments: &F
53
53
diag. span_suggestion_verbose (
54
54
last_doc_attr. span ( ) . shrink_to_hi ( ) ,
55
55
"add footnote definition" ,
56
- format ! ( "{pfx}{label}: <!-- description -->{sfx}" , label = & doc[ start..end] ) ,
56
+ format ! (
57
+ "{to_add}{label}: <!-- description -->{terminator}" ,
58
+ label = & doc[ start..end]
59
+ ) ,
57
60
Applicability :: HasPlaceholders ,
58
61
) ;
59
62
} else {
0 commit comments