Move boxing of ParseError into ParseErrorType.

This commit is contained in:
Stephen Chung
2020-05-22 18:28:13 +08:00
parent 2f0ab18b70
commit e224550861
7 changed files with 59 additions and 65 deletions

View File

@@ -80,7 +80,7 @@ pub trait Func<ARGS, RET> {
self,
script: &str,
entry_point: &str,
) -> Result<Self::Output, Box<ParseError>>;
) -> Result<Self::Output, ParseError>;
}
macro_rules! def_anonymous_fn {
@@ -103,7 +103,7 @@ macro_rules! def_anonymous_fn {
})
}
fn create_from_script(self, script: &str, entry_point: &str) -> Result<Self::Output, Box<ParseError>> {
fn create_from_script(self, script: &str, entry_point: &str) -> Result<Self::Output, ParseError> {
let ast = self.compile(script)?;
Ok(Func::<($($par,)*), RET>::create_from_ast(self, ast, entry_point))
}