about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvi_mi <49019259+feniljain@users.noreply.github.com>2022-02-22 19:46:50 +0530
committerGitHub <noreply@github.com>2022-02-22 19:46:50 +0530
commit7abd7b80f34481cabd7f2db032060f6e984c7b96 (patch)
treed43d9da047a280e184ddf390554ad40ba3d03438
parent192b6f5a78a122f3c1c2a459b4fa87ed624f4469 (diff)
downloadrust-7abd7b80f34481cabd7f2db032060f6e984c7b96.tar.gz
rust-7abd7b80f34481cabd7f2db032060f6e984c7b96.zip
chore: reposition comment
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
-rw-r--r--crates/ide_assists/src/handlers/extract_module.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/ide_assists/src/handlers/extract_module.rs b/crates/ide_assists/src/handlers/extract_module.rs
index d3652d68d8a..64875adfae2 100644
--- a/crates/ide_assists/src/handlers/extract_module.rs
+++ b/crates/ide_assists/src/handlers/extract_module.rs
@@ -779,12 +779,8 @@ fn get_replacements_for_visibilty_change(
             ast::Item::Enum(it) => replacements.push((it.visibility(), it.syntax().clone())),
             ast::Item::ExternCrate(it) => replacements.push((it.visibility(), it.syntax().clone())),
             ast::Item::Fn(it) => replacements.push((it.visibility(), it.syntax().clone())),
-            ast::Item::Impl(it) => {
-                //Associated item's visibility should not be changed
-                if let None = it.for_token() {
-                    impls.push(it);
-                }
-            }
+            //Associated item's visibility should not be changed
+            ast::Item::Impl(it) if it.for_token().is_none() => impls.push(it),
             ast::Item::MacroRules(it) => replacements.push((it.visibility(), it.syntax().clone())),
             ast::Item::MacroDef(it) => replacements.push((it.visibility(), it.syntax().clone())),
             ast::Item::Module(it) => replacements.push((it.visibility(), it.syntax().clone())),