3
3
use std:: {
4
4
collections:: { HashMap , HashSet } ,
5
5
fs:: { self } ,
6
- io:: { self , Cursor } ,
6
+ io:: Cursor ,
7
7
ops:: Deref ,
8
8
path:: { Path , PathBuf } ,
9
9
} ;
@@ -21,7 +21,7 @@ static NATIVE_EXTENSION_SUFFIX: &str = ".cpython-312-wasm32-wasi.so";
21
21
type ConfigsMatchedWorlds < ' a > =
22
22
IndexMap < String , ( ConfigContext < ComponentizePyConfig > , Option < & ' a str > ) > ;
23
23
24
- pub fn embedded_python_standard_library ( ) -> Result < TempDir , io :: Error > {
24
+ pub fn embedded_python_standard_library ( ) -> Result < TempDir > {
25
25
// Untar the embedded copy of the Python standard library into a temporary directory
26
26
let stdlib = tempfile:: tempdir ( ) ?;
27
27
@@ -35,7 +35,7 @@ pub fn embedded_python_standard_library() -> Result<TempDir, io::Error> {
35
35
Ok ( stdlib)
36
36
}
37
37
38
- pub fn embedded_helper_utils ( ) -> Result < TempDir , io :: Error > {
38
+ pub fn embedded_helper_utils ( ) -> Result < TempDir > {
39
39
// Untar the embedded copy of helper utilities into a temporary directory
40
40
let bundled = tempfile:: tempdir ( ) ?;
41
41
@@ -49,9 +49,7 @@ pub fn embedded_helper_utils() -> Result<TempDir, io::Error> {
49
49
Ok ( bundled)
50
50
}
51
51
52
- pub fn bundle_libraries (
53
- library_path : Vec < ( & str , Vec < PathBuf > ) > ,
54
- ) -> Result < Vec < Library > , anyhow:: Error > {
52
+ pub fn bundle_libraries ( library_path : Vec < ( & str , Vec < PathBuf > ) > ) -> Result < Vec < Library > > {
55
53
let mut libraries = vec ! [
56
54
Library {
57
55
name: "libcomponentize_py_runtime.so" . into( ) ,
@@ -152,7 +150,7 @@ pub fn search_for_libraries_and_configs<'a>(
152
150
python_path : & ' a Vec < & ' a str > ,
153
151
module_worlds : & ' a [ ( & ' a str , & ' a str ) ] ,
154
152
world : Option < & ' a str > ,
155
- ) -> Result < ( ConfigsMatchedWorlds < ' a > , Vec < Library > ) , anyhow :: Error > {
153
+ ) -> Result < ( ConfigsMatchedWorlds < ' a > , Vec < Library > ) > {
156
154
let mut raw_configs: Vec < ConfigContext < RawComponentizePyConfig > > = Vec :: new ( ) ;
157
155
let mut library_path: Vec < ( & str , Vec < PathBuf > ) > = Vec :: with_capacity ( python_path. len ( ) ) ;
158
156
for path in python_path {
@@ -219,7 +217,7 @@ fn search_directory(
219
217
libraries : & mut Vec < PathBuf > ,
220
218
configs : & mut Vec < ConfigContext < RawComponentizePyConfig > > ,
221
219
modules_seen : & mut HashSet < String > ,
222
- ) -> Result < ( ) , anyhow :: Error > {
220
+ ) -> Result < ( ) > {
223
221
if path. is_dir ( ) {
224
222
for entry in fs:: read_dir ( path) . with_context ( || path. display ( ) . to_string ( ) ) ? {
225
223
search_directory ( root, & entry?. path ( ) , libraries, configs, modules_seen) ?;
0 commit comments