This commit is contained in:
@@ -14,6 +14,9 @@
|
||||
#![feature(adt_const_params)]
|
||||
#![cfg_attr(not(feature = "mock_data"), no_std)]
|
||||
#![allow(incomplete_features)]
|
||||
// These give false positives too often
|
||||
#![allow(clippy::borrowed_box)]
|
||||
#![allow(clippy::needless_lifetimes)]
|
||||
|
||||
extern crate alloc;
|
||||
extern crate core;
|
||||
@@ -24,6 +27,7 @@ static ALLOC: dlmalloc::GlobalDlmalloc = dlmalloc::GlobalDlmalloc {};
|
||||
|
||||
pub(crate) use crate::app_interface::StringKey;
|
||||
pub(crate) use crate::handling::extern_ref::*;
|
||||
use alloc::boxed::Box;
|
||||
|
||||
#[macro_use]
|
||||
#[allow(dead_code)]
|
||||
@@ -31,8 +35,12 @@ pub mod app_interface;
|
||||
pub mod handling;
|
||||
pub mod utils;
|
||||
|
||||
pub type LoadScriptFnType = Box<dyn Fn(ScriptCategory, &StringKey) -> Option<Box<dyn Script>>>;
|
||||
|
||||
#[cfg(not(feature = "mock_data"))]
|
||||
mod implementation {
|
||||
use super::LoadScriptFnType;
|
||||
|
||||
use crate::app_interface::list::{EffectParameterImmutableList, ImmutableListWasm};
|
||||
use crate::app_interface::{
|
||||
BattleImpl, DamageSource, DynamicLibraryImpl, EffectParameter, ExecutingMoveImpl, ItemImpl,
|
||||
@@ -48,8 +56,6 @@ mod implementation {
|
||||
use cstr_core::{c_char, CString};
|
||||
use hashbrown::HashMap;
|
||||
|
||||
pub type LoadScriptFnType = Box<dyn Fn(ScriptCategory, &StringKey) -> Option<Box<dyn Script>>>;
|
||||
|
||||
static mut LOAD_SCRIPT_FN: Option<LoadScriptFnType> = None;
|
||||
|
||||
pub fn set_load_script_fn(f: LoadScriptFnType) {
|
||||
@@ -663,5 +669,9 @@ mod implementation {
|
||||
}
|
||||
}
|
||||
|
||||
use crate::handling::{Script, ScriptCategory};
|
||||
#[cfg(not(feature = "mock_data"))]
|
||||
pub use implementation::*;
|
||||
|
||||
#[cfg(feature = "mock_data")]
|
||||
pub fn set_load_script_fn(_f: LoadScriptFnType) {}
|
||||
|
||||
Reference in New Issue
Block a user