Skip to content

Commit a5f4d5d

Browse files
notriddleblyxyas
andcommitted
Use better variable names
Co-authored-by: Alejandra González <[email protected]>
1 parent 3d8e0d3 commit a5f4d5d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

clippy_lints/src/doc/doc_suspicious_footnotes.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub fn check(cx: &LateContext<'_>, doc: &str, range: Range<usize>, fragments: &F
4444
"looks like a footnote ref, but has no matching footnote",
4545
|diag| {
4646
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()) {
4848
(CommentKind::Line, AttrStyle::Outer) => ("\n///\n/// ", ""),
4949
(CommentKind::Line, AttrStyle::Inner) => ("\n//!\n//! ", ""),
5050
(CommentKind::Block, AttrStyle::Outer) => ("\n/** ", " */"),
@@ -53,7 +53,10 @@ pub fn check(cx: &LateContext<'_>, doc: &str, range: Range<usize>, fragments: &F
5353
diag.span_suggestion_verbose(
5454
last_doc_attr.span().shrink_to_hi(),
5555
"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+
),
5760
Applicability::HasPlaceholders,
5861
);
5962
} else {

0 commit comments

Comments
 (0)