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;
|
||||
use heromodels::models::projects::register_projects_rhai_module;
|
||||
use rhai::{Engine, EvalAltResult, Scope};
|
||||
use std::fs;
|
||||
use std::sync::Arc;
|
||||
|
||||
fn main() -> Result<(), Box<EvalAltResult>> {
|
||||
println!("Executing Rhai script: examples/project_rhai/project_test.rhai");
|
||||
@@ -18,8 +18,12 @@ fn main() -> Result<(), Box<EvalAltResult>> {
|
||||
|
||||
// Read the Rhai script from file
|
||||
let script_path = "examples/project_rhai/project_test.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