From 98971b060646e370d6e321a7db3e53e8ccb0b408 Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Mon, 13 Nov 2023 10:14:40 +0000 Subject: [PATCH] more info on find_runtime_path --- src/utils.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils.rs b/src/utils.rs index 6f6591f..fb7b32a 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -36,7 +36,8 @@ pub fn find_runtime_path(libraries: &[&str] ) -> Result { let emsdk_lib_paths = vec![emsdk_lib.as_str()]; let lib_path_env = env::var("LIBRARY_PATH").unwrap_or("".to_owned()); let library_paths = lib_path_env.split(":").collect::>(); - for &path in emsdk_lib_paths.iter().chain(library_paths.iter()) { + let all_paths = emsdk_lib_paths.into_iter().chain(library_paths.into_iter()).collect::>(); + for &path in all_paths.iter() { // check if all librarys are in the path let mut found = true; for library in libraries { @@ -50,7 +51,7 @@ pub fn find_runtime_path(libraries: &[&str] ) -> Result { return Ok(path.to_owned()); } } - Err(anyhow!("Could not find {:?} in LIBRARY_PATH {:?}", libraries, emsdk_lib_paths.iter().chain(library_paths.iter()))) + Err(anyhow!("Could not find {:?} in LIBRARY_PATH {:?}", libraries, all_paths)) } pub fn find_library_path(varients: &[& str]) -> Result {