Skip to content

Commit 1bc9d5c

Browse files
committed
Reword help message for both module_style lints
1 parent 86a7f28 commit 1bc9d5c

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

clippy_lints/src/module_style.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,7 @@ impl EarlyLintPass for ModStyle {
119119
|build| {
120120
let mut lint =
121121
build.build(&format!("`mod.rs` files are required, found `{}`", path.display()));
122-
lint.help(&format!(
123-
"create a `{}` file and remove `{}`",
124-
correct.display(),
125-
path.display(),
126-
));
122+
lint.help(&format!("move `{}` to `{}`", path.display(), correct.display(),));
127123
lint.emit();
128124
},
129125
);
@@ -166,11 +162,7 @@ fn check_self_named_mod_exists(cx: &EarlyContext<'_>, path: &Path, file: &Source
166162
Span::new(file.start_pos, file.start_pos, SyntaxContext::root()),
167163
|build| {
168164
let mut lint = build.build(&format!("`mod.rs` files are not allowed, found `{}`", path.display()));
169-
lint.help(&format!(
170-
"create a `{}` file and remove `{}`",
171-
mod_file.display(),
172-
path.display(),
173-
));
165+
lint.help(&format!("move `{}` to `{}`", path.display(), mod_file.display(),));
174166
lint.emit();
175167
},
176168
);

tests/ui-cargo/module_style/fail_mod/src/main.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ LL | pub mod stuff;
55
| ^
66
|
77
= note: `-D clippy::self-named-module-files` implied by `-D warnings`
8-
= help: create a `/bad/inner/mod.rs` file and remove `/bad/inner.rs`
8+
= help: move `/bad/inner.rs` to `/bad/inner/mod.rs`
99

1010
error: `mod.rs` files are required, found `/bad/inner/stuff.rs`
1111
--> $DIR/bad/inner/stuff.rs:1:1
1212
|
1313
LL | pub mod most;
1414
| ^
1515
|
16-
= help: create a `/bad/inner/stuff/mod.rs` file and remove `/bad/inner/stuff.rs`
16+
= help: move `/bad/inner/stuff.rs` to `/bad/inner/stuff/mod.rs`
1717

1818
error: aborting due to 2 previous errors
1919

tests/ui-cargo/module_style/fail_no_mod/src/main.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | pub struct Thing;
55
| ^
66
|
77
= note: `-D clippy::mod-module-files` implied by `-D warnings`
8-
= help: create a `/bad.rs` file and remove `/bad/mod.rs`
8+
= help: move `/bad/mod.rs` to `/bad.rs`
99

1010
error: aborting due to previous error
1111

0 commit comments

Comments
 (0)