diff --git a/clippy_lints/src/module_style.rs b/clippy_lints/src/module_style.rs index fafa4defb3d2..118424656616 100644 --- a/clippy_lints/src/module_style.rs +++ b/clippy_lints/src/module_style.rs @@ -119,11 +119,7 @@ impl EarlyLintPass for ModStyle { |build| { let mut lint = build.build(&format!("`mod.rs` files are required, found `{}`", path.display())); - lint.help(&format!( - "create a `{}` file and remove `{}`", - correct.display(), - path.display(), - )); + lint.help(&format!("move `{}` to `{}`", path.display(), correct.display(),)); lint.emit(); }, ); @@ -166,11 +162,7 @@ fn check_self_named_mod_exists(cx: &EarlyContext<'_>, path: &Path, file: &Source Span::new(file.start_pos, file.start_pos, SyntaxContext::root()), |build| { let mut lint = build.build(&format!("`mod.rs` files are not allowed, found `{}`", path.display())); - lint.help(&format!( - "create a `{}` file and remove `{}`", - mod_file.display(), - path.display(), - )); + lint.help(&format!("move `{}` to `{}`", path.display(), mod_file.display(),)); lint.emit(); }, ); diff --git a/tests/ui-cargo/module_style/fail_mod/src/main.stderr b/tests/ui-cargo/module_style/fail_mod/src/main.stderr index 89783d594f75..af4c298b3108 100644 --- a/tests/ui-cargo/module_style/fail_mod/src/main.stderr +++ b/tests/ui-cargo/module_style/fail_mod/src/main.stderr @@ -5,7 +5,7 @@ LL | pub mod stuff; | ^ | = note: `-D clippy::self-named-module-files` implied by `-D warnings` - = help: create a `/bad/inner/mod.rs` file and remove `/bad/inner.rs` + = help: move `/bad/inner.rs` to `/bad/inner/mod.rs` error: `mod.rs` files are required, found `/bad/inner/stuff.rs` --> $DIR/bad/inner/stuff.rs:1:1 @@ -13,7 +13,7 @@ error: `mod.rs` files are required, found `/bad/inner/stuff.rs` LL | pub mod most; | ^ | - = help: create a `/bad/inner/stuff/mod.rs` file and remove `/bad/inner/stuff.rs` + = help: move `/bad/inner/stuff.rs` to `/bad/inner/stuff/mod.rs` error: aborting due to 2 previous errors diff --git a/tests/ui-cargo/module_style/fail_no_mod/src/main.stderr b/tests/ui-cargo/module_style/fail_no_mod/src/main.stderr index 8300a135cf65..11e15db7fb96 100644 --- a/tests/ui-cargo/module_style/fail_no_mod/src/main.stderr +++ b/tests/ui-cargo/module_style/fail_no_mod/src/main.stderr @@ -5,7 +5,7 @@ LL | pub struct Thing; | ^ | = note: `-D clippy::mod-module-files` implied by `-D warnings` - = help: create a `/bad.rs` file and remove `/bad/mod.rs` + = help: move `/bad/mod.rs` to `/bad.rs` error: aborting due to previous error