Skip to content

Commit

Permalink
fix: Fixed spacing for comment suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
vHugoObject committed Sep 11, 2024
1 parent b0ecb3e commit bf8fbf7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion clippy_lints/src/doc/too_long_first_doc_paragraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ pub(super) fn check(
let Some(comment_form) = first.get(..3) else {
return;
};

diag.span_suggestion(
new_span,
"add an empty line",
format!("{snippet}{comment_form}\n"),
format!("{snippet}{comment_form}{snippet}"),
Applicability::MachineApplicable,
);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/too_long_first_doc_paragraph_module_level.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub mod foo {
// in foo.rs
//! A very short summary.
//!
//! A much longer explanation that goes into a lot more detail about
//! A much longer explanation that goes into a lot more detail about
//! how the thing works, possibly with doclinks and so one,
//! and probably spanning a many rows. Blablabla, it needs to be over
//! 200 characters so I needed to write something longeeeeeeer.
Expand Down
1 change: 1 addition & 0 deletions tests/ui/too_long_first_doc_paragraph_module_level.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ help: add an empty line
|
LL ~ //! A very short summary.
LL + //!
LL ~ //! A much longer explanation that goes into a lot more detail about
|

error: aborting due to 1 previous error
Expand Down

0 comments on commit bf8fbf7

Please sign in to comment.