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:
@ -1,5 +1,4 @@
|
||||
use super::{BidError, BidResult, NyashHostVtable, NyashPluginInfo};
|
||||
use std::os::raw::c_char;
|
||||
|
||||
/// Plugin API function signatures for C FFI
|
||||
///
|
||||
@ -164,7 +163,7 @@ impl HostVtableBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn with_alloc<F>(mut self, f: F) -> Self
|
||||
pub fn with_alloc<F>(self, _f: F) -> Self
|
||||
where
|
||||
F: Fn(usize) -> *mut std::os::raw::c_void + 'static,
|
||||
{
|
||||
@ -173,14 +172,14 @@ impl HostVtableBuilder {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_free<F>(mut self, f: F) -> Self
|
||||
pub fn with_free<F>(self, _f: F) -> Self
|
||||
where
|
||||
F: Fn(*mut std::os::raw::c_void) + 'static,
|
||||
{
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_log<F>(mut self, f: F) -> Self
|
||||
pub fn with_log<F>(self, _f: F) -> Self
|
||||
where
|
||||
F: Fn(&str) + 'static,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user