about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAmos Wenger <amoswenger@gmail.com>2022-07-25 14:18:28 +0200
committerAmos Wenger <amoswenger@gmail.com>2022-07-25 14:18:30 +0200
commitdc9405081531d0f3e68d984290b4d752bee3b9bd (patch)
tree9c60f21b184b22d52de223a07cbbb7bc2945f624
parent0d04e6362726dcb32a43ba6e18f2860cb9e03dbf (diff)
downloadrust-dc9405081531d0f3e68d984290b4d752bee3b9bd.tar.gz
rust-dc9405081531d0f3e68d984290b4d752bee3b9bd.zip
revert nightly rustfmt formatting that accidentally slipped in
cf. https://github.com/rust-lang/rust/pull/99603
cf. https://github.com/rust-lang/rust-analyzer/pull/12871#discussion_r928816339
-rw-r--r--crates/hir-def/src/import_map.rs6
-rw-r--r--crates/hir-def/src/nameres.rs6
-rw-r--r--crates/proc-macro-test/build.rs3
3 files changed, 11 insertions, 4 deletions
diff --git a/crates/hir-def/src/import_map.rs b/crates/hir-def/src/import_map.rs
index 688055e430b..05e0ceb05a9 100644
--- a/crates/hir-def/src/import_map.rs
+++ b/crates/hir-def/src/import_map.rs
@@ -167,7 +167,11 @@ fn collect_import_map(db: &dyn DefDatabase, krate: CrateId) -> ImportMap {
 
         let visible_items = mod_data.scope.entries().filter_map(|(name, per_ns)| {
             let per_ns = per_ns.filter_visibility(|vis| vis == Visibility::Public);
-            if per_ns.is_none() { None } else { Some((name, per_ns)) }
+            if per_ns.is_none() {
+                None
+            } else {
+                Some((name, per_ns))
+            }
         });
 
         for (name, per_ns) in visible_items {
diff --git a/crates/hir-def/src/nameres.rs b/crates/hir-def/src/nameres.rs
index 756fd583af4..3949fbb6e7b 100644
--- a/crates/hir-def/src/nameres.rs
+++ b/crates/hir-def/src/nameres.rs
@@ -334,7 +334,11 @@ impl DefMap {
 
     pub(crate) fn crate_root(&self, db: &dyn DefDatabase) -> ModuleId {
         self.with_ancestor_maps(db, self.root, &mut |def_map, _module| {
-            if def_map.block.is_none() { Some(def_map.module_id(def_map.root)) } else { None }
+            if def_map.block.is_none() {
+                Some(def_map.module_id(def_map.root))
+            } else {
+                None
+            }
         })
         .expect("DefMap chain without root")
     }
diff --git a/crates/proc-macro-test/build.rs b/crates/proc-macro-test/build.rs
index c90144509de..a80c962617b 100644
--- a/crates/proc-macro-test/build.rs
+++ b/crates/proc-macro-test/build.rs
@@ -62,8 +62,7 @@ fn main() {
         Command::new(toolchain::cargo())
     };
 
-    cmd
-        .current_dir(&staging_dir)
+    cmd.current_dir(&staging_dir)
         .args(&["build", "-p", "proc-macro-test-impl", "--message-format", "json"])
         // Explicit override the target directory to avoid using the same one which the parent
         // cargo is using, or we'll deadlock.