ref: Restructure module_lookup a bit
This makes the formatting a little less confusing.
@@ -202,14 +202,13 @@ impl ModuleLookup {
features,
} = ppdb_cache_actor.fetch(request).await;
- (
- idx,
- CacheFile {
+ let cache_file = CacheFile {
file: cache.map(CacheFileEntry::PortablePdbCache),
candidates,
features,
- },
- )
+ };
+
+ (idx, cache_file)
}
_ => {
let request = FetchSymCache {
@@ -225,30 +224,27 @@ impl ModuleLookup {
features,
} = symcache_actor.fetch(request).await;
- (
- idx,
- CacheFile {
+ let cache_file = CacheFile {
file: cache.map(CacheFileEntry::SymCache),
candidates,
features,
- },
- )
- }
+ };
+
+ (idx, cache_file)
}
}
- .bind_hub(Hub::new_from_top(Hub::current()));
- Some(fut)
+ };
+
+ Some(fut.bind_hub(Hub::new_from_top(Hub::current())))
});
- for (
- idx,
- CacheFile {
+ for (idx, cache_file) in future::join_all(futures).await {
+ let CacheFile {
file,
candidates,
features,
- },
- ) in future::join_all(futures).await
- {
+ } = cache_file;
+
if let Some(entry) = self.modules.get_mut(idx) {
entry.object_info.arch = Default::default();
entry.object_info.features.merge(features);
@@ -303,8 +299,7 @@ impl ModuleLookup {
scope: self.scope.clone(),
};
- Some(
- async move {
+ let fut = async move {
let FindResult { meta, candidates } = objects.find(find_request).await;
let source_object = match meta {
@@ -316,9 +311,9 @@ impl ModuleLookup {
};
(idx, source_object, candidates)
- }
- .bind_hub(Hub::new_from_top(Hub::current())),
- )
+ };
+
+ Some(fut.bind_hub(Hub::new_from_top(Hub::current())))
});
for (idx, source_object, candidates) in future::join_all(futures).await {
