fix: Replace static mut with Lazy for thread safety in FileBoxRegistry

- Eliminate static_mut_refs warnings by using once_cell::sync::Lazy
- Make FileMode enum public to fix private_interfaces warning
- Reduce warnings from 6 to 3
- Prepare for Rust 2024 edition compatibility
This commit is contained in:
Moe Charm
2025-08-21 12:14:33 +09:00
parent 11c8672252
commit 4f360e0fbb
16 changed files with 38 additions and 43 deletions

View File

@ -19,8 +19,7 @@ use nyash_rust::runtime::NyashRuntime;
use nyash_rust::interpreter::SharedState;
use nyash_rust::box_factory::user_defined::UserDefinedBoxFactory;
use nyash_rust::core::model::BoxDeclaration as CoreBoxDecl;
use std::sync::{Arc, RwLock};
use std::collections::HashMap;
use std::sync::Arc;
#[cfg(feature = "wasm-backend")]
use nyash_rust::backend::{wasm::WasmBackend, aot::AotBackend};
@ -289,7 +288,7 @@ impl NyashRunner {
// Dump MIR if requested
if self.config.dump_mir {
let mut printer = if self.config.mir_verbose {
let printer = if self.config.mir_verbose {
MirPrinter::verbose()
} else {
MirPrinter::new()