11#![ deny( warnings) ]
22
33use std:: {
4- collections:: { HashMap , HashSet } , fs:: { self } , io:: { self , Cursor } , ops:: Deref , path:: { Path , PathBuf }
4+ collections:: { HashMap , HashSet } ,
5+ fs:: { self } ,
6+ io:: { self , Cursor } ,
7+ ops:: Deref ,
8+ path:: { Path , PathBuf } ,
59} ;
610
711use anyhow:: { anyhow, bail, Context , Result } ;
@@ -90,8 +94,17 @@ fn library_from_so(library_name: &str) -> Result<Library, io::Error> {
9094 } )
9195}
9296
93- pub fn search_for_libraries_and_configs < ' a > ( python_path : & ' a Vec < & ' a str > , module_worlds : & ' a [ ( & ' a str , & ' a str ) ] )
94- -> Result < ( IndexMap < String , ( ConfigContext < ComponentizePyConfig > , Option < & ' a str > ) > , Vec < Library > ) , anyhow:: Error > {
97+ pub fn search_for_libraries_and_configs < ' a > (
98+ python_path : & ' a Vec < & ' a str > ,
99+ module_worlds : & ' a [ ( & ' a str , & ' a str ) ] ,
100+ world : Option < & ' a str > ,
101+ ) -> Result <
102+ (
103+ IndexMap < String , ( ConfigContext < ComponentizePyConfig > , Option < & ' a str > ) > ,
104+ Vec < Library > ,
105+ ) ,
106+ anyhow:: Error ,
107+ > {
95108 let mut raw_configs: Vec < crate :: ConfigContext < crate :: RawComponentizePyConfig > > = Vec :: new ( ) ;
96109 let mut library_path: Vec < ( & str , Vec < std:: path:: PathBuf > ) > =
97110 Vec :: with_capacity ( python_path. len ( ) ) ;
@@ -107,7 +120,7 @@ pub fn search_for_libraries_and_configs<'a>(python_path: &'a Vec<&'a str>, modul
107120 library_path. push ( ( * path, libraries) ) ;
108121 }
109122
110- let mut libraries = bundle_libraries ( library_path) ?;
123+ let libraries = bundle_libraries ( library_path) ?;
111124
112125 // Validate the paths parsed from any componentize-py.toml files discovered above and match them up with
113126 // `module_worlds` entries. Note that we use an `IndexMap` to preserve the order specified in `module_worlds`,
@@ -229,4 +242,4 @@ fn module_name(root: &Path, path: &Path) -> Option<String> {
229242 } else {
230243 None
231244 }
232- }
245+ }
0 commit comments