fmt, fixes and additions
This commit is contained in:
		@@ -1,8 +1,8 @@
 | 
			
		||||
use rhai::{Engine, EvalAltResult, Scope};
 | 
			
		||||
use std::sync::Arc;
 | 
			
		||||
use heromodels::db::hero::OurDB; // Corrected path for OurDB
 | 
			
		||||
use heromodels::models::biz::register_biz_rhai_module; // Corrected path
 | 
			
		||||
use rhai::{Engine, EvalAltResult, Scope};
 | 
			
		||||
use std::fs;
 | 
			
		||||
use std::sync::Arc;
 | 
			
		||||
 | 
			
		||||
fn main() -> Result<(), Box<EvalAltResult>> {
 | 
			
		||||
    println!("Executing Rhai script: examples/biz_rhai/biz.rhai");
 | 
			
		||||
@@ -20,8 +20,12 @@ fn main() -> Result<(), Box<EvalAltResult>> {
 | 
			
		||||
 | 
			
		||||
    // Read the Rhai script from file
 | 
			
		||||
    let script_path = "examples/biz_rhai/biz.rhai";
 | 
			
		||||
    let script_content = fs::read_to_string(script_path)
 | 
			
		||||
        .map_err(|e| Box::new(EvalAltResult::ErrorSystem(format!("Cannot read script file: {}", script_path), e.into())))?;
 | 
			
		||||
    let script_content = fs::read_to_string(script_path).map_err(|e| {
 | 
			
		||||
        Box::new(EvalAltResult::ErrorSystem(
 | 
			
		||||
            format!("Cannot read script file: {}", script_path),
 | 
			
		||||
            e.into(),
 | 
			
		||||
        ))
 | 
			
		||||
    })?;
 | 
			
		||||
 | 
			
		||||
    // Create a new scope
 | 
			
		||||
    let mut scope = Scope::new();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user