@@ -7,7 +7,7 @@ use std::path::{Path, PathBuf};
77use std:: sync:: Arc ;
88use std:: { env, io} ;
99use tar:: Archive ;
10- use tracing:: { debug, instrument , warn} ;
10+ use tracing:: { debug, warn} ;
1111
1212pub const DEFAULT_JAVA_VERSION : & str = "21.0.8.9.1" ;
1313
@@ -26,8 +26,7 @@ pub async fn default_class_loader() -> Result<(PathBuf, String, Arc<ClassLoader>
2626/// # Errors
2727///
2828/// An error will be returned if the class loader cannot be created.
29- #[ instrument( level = "debug" ) ]
30- pub async fn home_class_loader ( java_home : & PathBuf ) -> Result < ( PathBuf , String , Arc < ClassLoader > ) > {
29+ pub async fn home_class_loader ( java_home : & Path ) -> Result < ( PathBuf , String , Arc < ClassLoader > ) > {
3130 let version_file = java_home. join ( "version.txt" ) ;
3231 // Corretto version 8 does not have a release file, but includes a version.txt file. Since most
3332 // versions of Corretto include a version.txt file, and it should be faster to process, we can
@@ -65,7 +64,7 @@ pub async fn home_class_loader(java_home: &PathBuf) -> Result<(PathBuf, String,
6564 let class_path = get_class_path ( & java_version, java_home) ?;
6665 let class_loader = ClassLoader :: new ( "bootstrap" , class_path) ;
6766 register_primitives ( & class_loader) . await ?;
68- Ok ( ( java_home. clone ( ) , java_version, class_loader) )
67+ Ok ( ( java_home. to_path_buf ( ) , java_version, class_loader) )
6968}
7069
7170/// Get a class loader for the given Java runtime version. If the version is not installed, the
@@ -75,7 +74,6 @@ pub async fn home_class_loader(java_home: &PathBuf) -> Result<(PathBuf, String,
7574/// # Errors
7675///
7776/// An error will be returned if the class loader cannot be created.
78- #[ instrument( level = "debug" ) ]
7977pub async fn version_class_loader ( version : & str ) -> Result < ( PathBuf , String , Arc < ClassLoader > ) > {
8078 let mut version = version. to_string ( ) ;
8179 #[ cfg( target_family = "wasm" ) ]
@@ -172,7 +170,6 @@ fn get_class_path(version: &str, installation_dir: &Path) -> Result<ClassPath> {
172170/// # Errors
173171///
174172/// An error will be returned if the archive cannot be extracted.
175- #[ instrument( level = "debug" , skip( archive) ) ]
176173async fn extract_archive (
177174 version : & str ,
178175 file_name : & str ,
0 commit comments