File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ fn collect_doc_replacements(attrs: &[Attribute]) -> Vec<(Span, String)> {
4242 } ;
4343
4444 let len = comment. len ( ) ;
45- let new_comment = format ! ( "{pre}{} \\ " , comment[ ..len - 2 ] . to_owned ( ) ) ;
45+ let new_comment = format ! ( "{pre}{}\\ " , & comment[ ..len - 2 ] ) ;
4646 Some ( ( attr. span , new_comment) )
4747 } else {
4848 None
Original file line number Diff line number Diff line change @@ -431,9 +431,9 @@ declare_clippy_lint! {
431431 /// is clearer in this regard.
432432 ///
433433 /// ### Example
434- /// The two dots in this example represent a double space.
434+ /// The two replacement dots in this example represent a double space.
435435 /// ```no_run
436- /// /// This command takes two numbers as inputs and..
436+ /// /// This command takes two numbers as inputs and··
437437 /// /// adds them together, and then returns the result.
438438 /// fn add(l: i32, r: i32) -> i32 {
439439 /// l + r
Original file line number Diff line number Diff line change 44#![warn(clippy::doc_comment_double_space_linebreak)]
55#![allow(unused)]
66
7- //! Should warn on double space linebreaks \
7+ //! Should warn on double space linebreaks\
88//! in file/module doc comment
99
1010/// Should not warn on single-line doc comments
@@ -31,8 +31,8 @@ fn normal_comment() {
3131 */
3232}
3333
34- /// Should warn when doc comment uses double space \
35- /// as a line-break, even when there are multiple \
34+ /// Should warn when doc comment uses double space\
35+ /// as a line-break, even when there are multiple\
3636/// in a row
3737fn double_space_doc_comment() {}
3838
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ error: doc comments should use a back-slash (\) instead of a double space to ind
22 --> tests/ui/doc/doc_comment_double_space_linebreak.rs:7:1
33 |
44LL | //! Should warn on double space linebreaks
5- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this double space with a back-slash: `//! Should warn on double space linebreaks \`
5+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this double space with a back-slash: `//! Should warn on double space linebreaks\`
66 |
77 = note: `-D clippy::doc-comment-double-space-linebreak` implied by `-D warnings`
88 = help: to override `-D warnings` add `#[allow(clippy::doc_comment_double_space_linebreak)]`
@@ -16,8 +16,8 @@ LL | | /// as a line-break, even when there are multiple
1616 |
1717help: replace this double space with a back-slash
1818 |
19- LL + /// Should warn when doc comment uses double space \
20- LL + /// as a line-break, even when there are multiple \
19+ LL + /// Should warn when doc comment uses double space\
20+ LL + /// as a line-break, even when there are multiple\
2121 |
2222
2323error: aborting due to 2 previous errors
You can’t perform that action at this time.
0 commit comments