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)> {
42
42
} ;
43
43
44
44
let len = comment. len ( ) ;
45
- let new_comment = format ! ( "{pre}{} \\ " , comment[ ..len - 2 ] . to_owned ( ) ) ;
45
+ let new_comment = format ! ( "{pre}{}\\ " , & comment[ ..len - 2 ] ) ;
46
46
Some ( ( attr. span , new_comment) )
47
47
} else {
48
48
None
Original file line number Diff line number Diff line change @@ -431,9 +431,9 @@ declare_clippy_lint! {
431
431
/// is clearer in this regard.
432
432
///
433
433
/// ### Example
434
- /// The two dots in this example represent a double space.
434
+ /// The two replacement dots in this example represent a double space.
435
435
/// ```no_run
436
- /// /// This command takes two numbers as inputs and..
436
+ /// /// This command takes two numbers as inputs and··
437
437
/// /// adds them together, and then returns the result.
438
438
/// fn add(l: i32, r: i32) -> i32 {
439
439
/// l + r
Original file line number Diff line number Diff line change 4
4
#![warn(clippy::doc_comment_double_space_linebreak)]
5
5
#![allow(unused)]
6
6
7
- //! Should warn on double space linebreaks \
7
+ //! Should warn on double space linebreaks\
8
8
//! in file/module doc comment
9
9
10
10
/// Should not warn on single-line doc comments
@@ -31,8 +31,8 @@ fn normal_comment() {
31
31
*/
32
32
}
33
33
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\
36
36
/// in a row
37
37
fn double_space_doc_comment() {}
38
38
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
2
2
--> tests/ui/doc/doc_comment_double_space_linebreak.rs:7:1
3
3
|
4
4
LL | //! 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\`
6
6
|
7
7
= note: `-D clippy::doc-comment-double-space-linebreak` implied by `-D warnings`
8
8
= 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
16
16
|
17
17
help: replace this double space with a back-slash
18
18
|
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\
21
21
|
22
22
23
23
error: aborting due to 2 previous errors
You can’t perform that action at this time.
0 commit comments