fix: bad indent in doc comments

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),///     \1,g'` and manually verified and fixed the relevant part of code that had bad indentation.
This commit is contained in:
tk 2025-03-16 19:36:09 +01:00
parent 775a5c2712
commit b23fcb0147
12 changed files with 24 additions and 24 deletions

View file

@ -17,15 +17,15 @@ declare_clippy_lint! {
/// ### Example
/// ```no_run
/// match std::fs::create_dir("tmp-work-dir") {
/// Ok(_) => println!("Working directory created"),
/// Err(s) => eprintln!("Could not create directory: {s}"),
/// Ok(_) => println!("Working directory created"),
/// Err(s) => eprintln!("Could not create directory: {s}"),
/// }
/// ```
/// Use instead:
/// ```no_run
/// match std::fs::create_dir("tmp-work-dir") {
/// Ok(()) => println!("Working directory created"),
/// Err(s) => eprintln!("Could not create directory: {s}"),
/// Ok(()) => println!("Working directory created"),
/// Err(s) => eprintln!("Could not create directory: {s}"),
/// }
/// ```
#[clippy::version = "1.73.0"]

View file

@ -28,9 +28,9 @@ declare_clippy_lint! {
/// use std::str::Chars;
/// struct Data {}
/// impl Data {
/// fn iter(&self) -> Chars<'static> {
/// todo!()
/// }
/// fn iter(&self) -> Chars<'static> {
/// todo!()
/// }
/// }
/// ```
#[clippy::version = "1.57.0"]

View file

@ -469,7 +469,7 @@ declare_clippy_lint! {
/// let item2 = 3;
/// let mut vec: Vec<u8> = Vec::new();
/// for _ in 0..20 {
/// vec.push(item1);
/// vec.push(item1);
/// }
/// for _ in 0..30 {
/// vec.push(item2);

View file

@ -29,7 +29,7 @@ declare_clippy_lint! {
/// Use instead:
/// ```no_run
/// fn compare(a: &str, b: &str) -> bool {
/// a.eq_ignore_ascii_case(b) || a.eq_ignore_ascii_case("abc")
/// a.eq_ignore_ascii_case(b) || a.eq_ignore_ascii_case("abc")
/// }
/// ```
#[clippy::version = "1.84.0"]

View file

@ -4447,13 +4447,13 @@ declare_clippy_lint! {
/// ### Example
/// ```no_run
/// fn foo(values: &[u8]) -> bool {
/// values.iter().any(|&v| v == 10)
/// values.iter().any(|&v| v == 10)
/// }
/// ```
/// Use instead:
/// ```no_run
/// fn foo(values: &[u8]) -> bool {
/// values.contains(&10)
/// values.contains(&10)
/// }
/// ```
#[clippy::version = "1.86.0"]

View file

@ -37,7 +37,7 @@ declare_clippy_lint! {
///
/// struct Baz;
/// impl Baz {
/// fn private() {} // ok
/// fn private() {} // ok
/// }
///
/// impl Bar for Baz {
@ -46,13 +46,13 @@ declare_clippy_lint! {
///
/// pub struct PubBaz;
/// impl PubBaz {
/// fn private() {} // ok
/// pub fn not_private() {} // missing #[inline]
/// fn private() {} // ok
/// pub fn not_private() {} // missing #[inline]
/// }
///
/// impl Bar for PubBaz {
/// fn bar() {} // missing #[inline]
/// fn def_bar() {} // missing #[inline]
/// fn bar() {} // missing #[inline]
/// fn def_bar() {} // missing #[inline]
/// }
/// ```
///

View file

@ -40,7 +40,7 @@ declare_clippy_lint! {
/// }
///
/// fn f(to: TO) -> Option<usize> {
/// to.magic
/// to.magic
/// }
///
/// struct TR {

View file

@ -19,8 +19,8 @@ declare_clippy_lint! {
/// struct Foo;
///
/// impl PartialEq for Foo {
/// fn eq(&self, other: &Foo) -> bool { true }
/// fn ne(&self, other: &Foo) -> bool { !(self == other) }
/// fn eq(&self, other: &Foo) -> bool { true }
/// fn ne(&self, other: &Foo) -> bool { !(self == other) }
/// }
/// ```
#[clippy::version = "pre 1.29.0"]

View file

@ -230,7 +230,7 @@ fn expr_return_none_or_err(
///
/// ```ignore
/// if option.is_none() {
/// return None;
/// return None;
/// }
/// ```
///

View file

@ -23,7 +23,7 @@ declare_clippy_lint! {
/// ### Example
/// ```no_run
/// let f = async {
/// 1 + 2
/// 1 + 2
/// };
/// let fut = async {
/// f.await
@ -32,7 +32,7 @@ declare_clippy_lint! {
/// Use instead:
/// ```no_run
/// let f = async {
/// 1 + 2
/// 1 + 2
/// };
/// let fut = f;
/// ```

View file

@ -26,7 +26,7 @@ declare_clippy_lint! {
/// let a = a;
///
/// fn foo(b: i32) {
/// let b = b;
/// let b = b;
/// }
/// ```
/// Use instead:

View file

@ -26,7 +26,7 @@ declare_clippy_lint! {
/// ```no_run
/// # let a: u32 = 42;
/// if a > 10 {
/// println!("a is greater than 10");
/// println!("a is greater than 10");
/// }
/// ```
#[clippy::version = "1.86.0"]