improve and add models
This commit is contained in:
@@ -2,7 +2,6 @@ use rhai::plugin::*;
|
||||
use rhai::{Engine, EvalAltResult, Position, Module, INT, Dynamic, Array};
|
||||
use std::sync::Arc;
|
||||
use std::mem;
|
||||
use chrono::{DateTime, Utc};
|
||||
use crate::db::Db;
|
||||
|
||||
use super::calendar::{Event, Attendee, Calendar, AttendanceStatus};
|
||||
@@ -22,16 +21,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_calendar_module {
|
||||
// --- Event Functions ---
|
||||
|
Reference in New Issue
Block a user