feat: Migrate SAL to Cargo workspace
- Migrate individual modules to independent crates - Refactor dependencies for improved modularity - Update build system and testing infrastructure - Update documentation to reflect new structure
This commit is contained in:
@@ -22,10 +22,7 @@ impl SalError {
|
||||
impl From<SalError> for Box<EvalAltResult> {
|
||||
fn from(err: SalError) -> Self {
|
||||
let err_msg = err.to_string();
|
||||
Box::new(EvalAltResult::ErrorRuntime(
|
||||
err_msg.into(),
|
||||
Position::NONE,
|
||||
))
|
||||
Box::new(EvalAltResult::ErrorRuntime(err_msg.into(), Position::NONE))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +42,6 @@ impl<T, E: std::error::Error> ToRhaiError<T> for Result<T, E> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Register all the SalError variants with the Rhai engine
|
||||
///
|
||||
/// # Arguments
|
||||
@@ -56,7 +52,8 @@ impl<T, E: std::error::Error> ToRhaiError<T> for Result<T, E> {
|
||||
///
|
||||
/// * `Result<(), Box<EvalAltResult>>` - Ok if registration was successful, Err otherwise
|
||||
pub fn register_error_types(engine: &mut Engine) -> Result<(), Box<EvalAltResult>> {
|
||||
engine.register_type_with_name::<SalError>("SalError")
|
||||
engine
|
||||
.register_type_with_name::<SalError>("SalError")
|
||||
.register_fn("to_string", |err: &mut SalError| err.to_string());
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user