usestd::cell::RefCell;usestd::sync::Arc;usesuper::XetRuntime;usecrate::config::XetConfig;// Use thread-local references to the config that caches access. This way, xet_config() will
// can be called outside of an existing runtime.
thread_local!{staticTHREAD_CONFIG_REF:RefCell<Option<Arc<XetConfig>>>=const{RefCell::new(None)};}pubfnxet_config()->Arc<XetConfig>{ifletSome(config)=THREAD_CONFIG_REF.with_borrow(|config|config.clone()){return config;}let config ={ifletSome(runtime)=XetRuntime::current_if_exists(){
runtime.config().clone()}else{Arc::new(XetConfig::new())}};THREAD_CONFIG_REF.set(Some(config.clone()));
config
}