improve and add models
This commit is contained in:
@@ -12,7 +12,6 @@ type RhaiSignatureRequirement = SignatureRequirement;
|
||||
use crate::db::hero::OurDB;
|
||||
use crate::db::Collection;
|
||||
use crate::db::Db;
|
||||
use heromodels_core::Model;
|
||||
|
||||
// Helper to convert i64 from Rhai to u32 for IDs
|
||||
fn id_from_i64_to_u32(id_i64: i64) -> Result<u32, Box<EvalAltResult>> {
|
||||
@@ -24,16 +23,6 @@ fn id_from_i64_to_u32(id_i64: i64) -> Result<u32, Box<EvalAltResult>> {
|
||||
)
|
||||
}
|
||||
|
||||
// Helper to convert i64 from Rhai to u64 for timestamps or other large numbers
|
||||
fn val_from_i64_to_u64(val_i64: i64) -> Result<u64, Box<EvalAltResult>> {
|
||||
u64::try_from(val_i64).map_err(|_|
|
||||
Box::new(EvalAltResult::ErrorArithmetic(
|
||||
format!("Failed to convert value '{}' to u64", val_i64).into(),
|
||||
Position::NONE
|
||||
))
|
||||
)
|
||||
}
|
||||
|
||||
#[export_module]
|
||||
mod rhai_flow_module {
|
||||
// --- Flow Functions ---
|
||||
|
Reference in New Issue
Block a user