Skip to content

Commit a422d9e

Browse files
authored
fix: bad indent in doc comments (rust-lang#14419)
TLDR ```diff - /// 01234 + /// 01234 12345 ``` Sometimes, in doc comments, there are 3 spaces + 1 instead of 4 spaces + 1. To make it coherent with the rest of the clippy codebase, I `fd -t f -X sed -E -i 's,///\s{4}(\S),/// \1,g'` and manually verified and fixed the relevant part of code that had bad indentation. ### Example ```rs /// fn a() { /// 01234 /// } ``` Becomes ```rs /// fn a() { /// 01234 /// } ``` changelog: none
2 parents d443f38 + b23fcb0 commit a422d9e

12 files changed

+24
-24
lines changed

clippy_lints/src/ignored_unit_patterns.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ declare_clippy_lint! {
1717
/// ### Example
1818
/// ```no_run
1919
/// match std::fs::create_dir("tmp-work-dir") {
20-
/// Ok(_) => println!("Working directory created"),
21-
/// Err(s) => eprintln!("Could not create directory: {s}"),
20+
/// Ok(_) => println!("Working directory created"),
21+
/// Err(s) => eprintln!("Could not create directory: {s}"),
2222
/// }
2323
/// ```
2424
/// Use instead:
2525
/// ```no_run
2626
/// match std::fs::create_dir("tmp-work-dir") {
27-
/// Ok(()) => println!("Working directory created"),
28-
/// Err(s) => eprintln!("Could not create directory: {s}"),
27+
/// Ok(()) => println!("Working directory created"),
28+
/// Err(s) => eprintln!("Could not create directory: {s}"),
2929
/// }
3030
/// ```
3131
#[clippy::version = "1.73.0"]

clippy_lints/src/iter_not_returning_iterator.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ declare_clippy_lint! {
2828
/// use std::str::Chars;
2929
/// struct Data {}
3030
/// impl Data {
31-
/// fn iter(&self) -> Chars<'static> {
32-
/// todo!()
33-
/// }
31+
/// fn iter(&self) -> Chars<'static> {
32+
/// todo!()
33+
/// }
3434
/// }
3535
/// ```
3636
#[clippy::version = "1.57.0"]

clippy_lints/src/loops/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ declare_clippy_lint! {
469469
/// let item2 = 3;
470470
/// let mut vec: Vec<u8> = Vec::new();
471471
/// for _ in 0..20 {
472-
/// vec.push(item1);
472+
/// vec.push(item1);
473473
/// }
474474
/// for _ in 0..30 {
475475
/// vec.push(item2);

clippy_lints/src/manual_ignore_case_cmp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ declare_clippy_lint! {
2929
/// Use instead:
3030
/// ```no_run
3131
/// fn compare(a: &str, b: &str) -> bool {
32-
/// a.eq_ignore_ascii_case(b) || a.eq_ignore_ascii_case("abc")
32+
/// a.eq_ignore_ascii_case(b) || a.eq_ignore_ascii_case("abc")
3333
/// }
3434
/// ```
3535
#[clippy::version = "1.84.0"]

clippy_lints/src/methods/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4447,13 +4447,13 @@ declare_clippy_lint! {
44474447
/// ### Example
44484448
/// ```no_run
44494449
/// fn foo(values: &[u8]) -> bool {
4450-
/// values.iter().any(|&v| v == 10)
4450+
/// values.iter().any(|&v| v == 10)
44514451
/// }
44524452
/// ```
44534453
/// Use instead:
44544454
/// ```no_run
44554455
/// fn foo(values: &[u8]) -> bool {
4456-
/// values.contains(&10)
4456+
/// values.contains(&10)
44574457
/// }
44584458
/// ```
44594459
#[clippy::version = "1.86.0"]

clippy_lints/src/missing_inline.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ declare_clippy_lint! {
3737
///
3838
/// struct Baz;
3939
/// impl Baz {
40-
/// fn private() {} // ok
40+
/// fn private() {} // ok
4141
/// }
4242
///
4343
/// impl Bar for Baz {
@@ -46,13 +46,13 @@ declare_clippy_lint! {
4646
///
4747
/// pub struct PubBaz;
4848
/// impl PubBaz {
49-
/// fn private() {} // ok
50-
/// pub fn not_private() {} // missing #[inline]
49+
/// fn private() {} // ok
50+
/// pub fn not_private() {} // missing #[inline]
5151
/// }
5252
///
5353
/// impl Bar for PubBaz {
54-
/// fn bar() {} // missing #[inline]
55-
/// fn def_bar() {} // missing #[inline]
54+
/// fn bar() {} // missing #[inline]
55+
/// fn def_bar() {} // missing #[inline]
5656
/// }
5757
/// ```
5858
///

clippy_lints/src/needless_question_mark.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ declare_clippy_lint! {
4040
/// }
4141
///
4242
/// fn f(to: TO) -> Option<usize> {
43-
/// to.magic
43+
/// to.magic
4444
/// }
4545
///
4646
/// struct TR {

clippy_lints/src/partialeq_ne_impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ declare_clippy_lint! {
1919
/// struct Foo;
2020
///
2121
/// impl PartialEq for Foo {
22-
/// fn eq(&self, other: &Foo) -> bool { true }
23-
/// fn ne(&self, other: &Foo) -> bool { !(self == other) }
22+
/// fn eq(&self, other: &Foo) -> bool { true }
23+
/// fn ne(&self, other: &Foo) -> bool { !(self == other) }
2424
/// }
2525
/// ```
2626
#[clippy::version = "pre 1.29.0"]

clippy_lints/src/question_mark.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ fn expr_return_none_or_err(
269269
///
270270
/// ```ignore
271271
/// if option.is_none() {
272-
/// return None;
272+
/// return None;
273273
/// }
274274
/// ```
275275
///

clippy_lints/src/redundant_async_block.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ declare_clippy_lint! {
2323
/// ### Example
2424
/// ```no_run
2525
/// let f = async {
26-
/// 1 + 2
26+
/// 1 + 2
2727
/// };
2828
/// let fut = async {
2929
/// f.await
@@ -32,7 +32,7 @@ declare_clippy_lint! {
3232
/// Use instead:
3333
/// ```no_run
3434
/// let f = async {
35-
/// 1 + 2
35+
/// 1 + 2
3636
/// };
3737
/// let fut = f;
3838
/// ```

clippy_lints/src/redundant_locals.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ declare_clippy_lint! {
2626
/// let a = a;
2727
///
2828
/// fn foo(b: i32) {
29-
/// let b = b;
29+
/// let b = b;
3030
/// }
3131
/// ```
3232
/// Use instead:

clippy_lints/src/unnecessary_semicolon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ declare_clippy_lint! {
2626
/// ```no_run
2727
/// # let a: u32 = 42;
2828
/// if a > 10 {
29-
/// println!("a is greater than 10");
29+
/// println!("a is greater than 10");
3030
/// }
3131
/// ```
3232
#[clippy::version = "1.86.0"]

0 commit comments

Comments
 (0)