Skip to content

Commit e11ebbd

Browse files
hehaoqianCentri3
andcommitted
Move continue into if statement
Co-authored-by: Catherine <[email protected]>
1 parent 65b93a5 commit e11ebbd

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

clippy_lints/src/module_style.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ impl EarlyLintPass for ModStyle {
9191
// `{ foo => path/to/foo.rs, .. }
9292
let mut file_map = FxHashMap::default();
9393
for file in files.iter() {
94-
if let FileName::Real(name) = &file.name && let Some(lp) = name.local_path() {
95-
if file.cnum != LOCAL_CRATE {
96-
// [#8887](https://github.com/rust-lang/rust-clippy/issues/8887)
97-
// Only check files in the current crate.
98-
// Fix false positive that crate dependency in workspace sub directory
99-
// is checked unintentionally.
100-
continue;
101-
}
94+
if let FileName::Real(name) = &file.name
95+
&& let Some(lp) = name.local_path()
96+
&& file.cnum == LOCAL_CRATE
97+
{
98+
// [#8887](https://github.com/rust-lang/rust-clippy/issues/8887)
99+
// Only check files in the current crate.
100+
// Fix false positive that crate dependency in workspace sub directory
101+
// is checked unintentionally.
102102
let path = if lp.is_relative() {
103103
lp
104104
} else if let Ok(relative) = lp.strip_prefix(trim_to_src) {

0 commit comments

Comments
 (0)