@@ -22,29 +22,32 @@ pub struct WorkspaceResolution {
22
22
fields( root = ws. root( ) . display( ) . to_string( ) )
23
23
) ]
24
24
pub fn resolve_workspace ( ws : & Workspace < ' _ > ) -> Result < WorkspaceResolution > {
25
- let registry = Registry :: preloaded ( ws. members ( ) , ws. config ( ) ) ;
26
- let mut registry_cache = RegistryCache :: new ( registry) ;
27
-
28
- let members_summaries = ws
29
- . members ( )
30
- . map ( |pkg| pkg. manifest . summary . clone ( ) )
31
- . collect :: < Vec < _ > > ( ) ;
32
-
33
- let resolve = resolver:: resolve ( & members_summaries, & mut registry_cache, ws. config ( ) ) ?;
34
-
35
- // Gather [`Package`] instances from this resolver result, by asking the [`RegistryCache`]
36
- // to download resolved packages.
37
- //
38
- // Currently, it is expected that all packages are already downloaded during resolution,
39
- // so the `download` calls in this method should be cheap, but this may change the future.
40
- let packages =
41
- async_collect_packages_from_resolve_graph ( & resolve, & mut registry_cache) . await_sync ( ) ?;
42
-
43
- Ok ( WorkspaceResolution { resolve, packages } )
25
+ async {
26
+ let registry = Registry :: preloaded ( ws. members ( ) , ws. config ( ) ) ;
27
+ let mut registry_cache = RegistryCache :: new ( registry) ;
28
+
29
+ let members_summaries = ws
30
+ . members ( )
31
+ . map ( |pkg| pkg. manifest . summary . clone ( ) )
32
+ . collect :: < Vec < _ > > ( ) ;
33
+
34
+ let resolve =
35
+ resolver:: resolve ( & members_summaries, & mut registry_cache, ws. config ( ) ) . await ?;
36
+
37
+ // Gather [`Package`] instances from this resolver result, by asking the [`RegistryCache`]
38
+ // to download resolved packages.
39
+ //
40
+ // Currently, it is expected that all packages are already downloaded during resolution,
41
+ // so the `download` calls in this method should be cheap, but this may change the future.
42
+ let packages = collect_packages_from_resolve_graph ( & resolve, & mut registry_cache) . await ?;
43
+
44
+ Ok ( WorkspaceResolution { resolve, packages } )
45
+ }
46
+ . await_sync ( )
44
47
}
45
48
46
49
#[ tracing:: instrument( level = "trace" , skip_all) ]
47
- async fn async_collect_packages_from_resolve_graph (
50
+ async fn collect_packages_from_resolve_graph (
48
51
resolve : & Resolve ,
49
52
registry : & mut RegistryCache < ' _ > ,
50
53
) -> Result < HashMap < PackageId , Package > > {
0 commit comments