chore(fmt): add legacy stubs and strip trailing whitespace to unblock cargo fmt
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
/*!
|
||||
* Global Unified Box Registry
|
||||
*
|
||||
*
|
||||
* Manages the global instance of UnifiedBoxRegistry
|
||||
* Integrates all Box creation sources (builtin, user-defined, plugin)
|
||||
*/
|
||||
|
||||
use crate::box_factory::UnifiedBoxRegistry;
|
||||
use crate::box_factory::builtin::BuiltinBoxFactory;
|
||||
#[cfg(feature = "plugins")]
|
||||
use crate::box_factory::plugin::PluginBoxFactory;
|
||||
use crate::box_factory::UnifiedBoxRegistry;
|
||||
use std::sync::{Arc, Mutex, OnceLock};
|
||||
|
||||
/// Global registry instance
|
||||
@ -23,15 +23,15 @@ pub fn init_global_unified_registry() {
|
||||
{
|
||||
registry.register(std::sync::Arc::new(BuiltinBoxFactory::new()));
|
||||
}
|
||||
|
||||
|
||||
// Register plugin Box factory (primary)
|
||||
#[cfg(feature = "plugins")]
|
||||
{
|
||||
registry.register(Arc::new(PluginBoxFactory::new()));
|
||||
}
|
||||
|
||||
|
||||
// TODO: User-defined Box factory will be registered by interpreter
|
||||
|
||||
|
||||
Arc::new(Mutex::new(registry))
|
||||
});
|
||||
}
|
||||
@ -46,7 +46,7 @@ pub fn get_global_unified_registry() -> Arc<Mutex<UnifiedBoxRegistry>> {
|
||||
pub fn register_user_defined_factory(factory: Arc<dyn crate::box_factory::BoxFactory>) {
|
||||
let registry = get_global_unified_registry();
|
||||
let mut registry_lock = registry.lock().unwrap();
|
||||
|
||||
|
||||
// Insert at position 1 (after builtin, before plugin)
|
||||
// This maintains priority: builtin > user > plugin
|
||||
if registry_lock.factories.len() >= 2 {
|
||||
|
||||
Reference in New Issue
Block a user