@@ -27,7 +27,10 @@ use wac_graph::{CompositionGraph, NodeId};
2727/// dependent component. Finally, the composer will export all exports from the
2828/// dependent component to its dependents. The composer will then encode the
2929/// composition graph into a byte array and return it.
30- pub async fn compose < L : ComponentSourceLoader , Fut : std:: future:: Future < Output = Result < Vec < u8 > , ComposeError > > > (
30+ pub async fn compose <
31+ L : ComponentSourceLoader ,
32+ Fut : std:: future:: Future < Output = Result < Vec < u8 > , ComposeError > > ,
33+ > (
3134 loader : & L ,
3235 component : & L :: Component ,
3336 complicator : impl Fn ( Vec < u8 > ) -> Fut ,
@@ -204,18 +207,20 @@ struct Composer<'a, L> {
204207}
205208
206209impl < ' a , L : ComponentSourceLoader > Composer < ' a , L > {
207- async fn compose < Fut : std:: future:: Future < Output = Result < Vec < u8 > , ComposeError > > > ( mut self , component : & L :: Component , complicator : impl Fn ( Vec < u8 > ) -> Fut ,
208- ) -> Result < Vec < u8 > , ComposeError > {
210+ async fn compose < Fut : std:: future:: Future < Output = Result < Vec < u8 > , ComposeError > > > (
211+ mut self ,
212+ component : & L :: Component ,
213+ complicator : impl Fn ( Vec < u8 > ) -> Fut ,
214+ ) -> Result < Vec < u8 > , ComposeError > {
209215 let source = self
210216 . loader
211217 . load_component_source ( component)
212218 . await
213219 . map_err ( ComposeError :: PrepareError ) ?;
214220
215- let fulfilled_source = if component. dependencies ( ) . len ( ) == 0 {
221+ let fulfilled_source = if component. dependencies ( ) . len ( ) == 0 {
216222 source
217223 } else {
218-
219224 let ( world_id, instantiation_id) = self
220225 . register_package ( component. id ( ) , None , source)
221226 . map_err ( ComposeError :: PrepareError ) ?;
0 commit comments