Move function back to correct file.

This commit is contained in:
Stephen Chung 2021-11-20 15:43:55 +08:00
parent 344b48ad36
commit fa41f4faf0
2 changed files with 5 additions and 5 deletions

View File

@ -193,9 +193,4 @@ impl Engine {
) -> Result<(), Box<EvalAltResult>> {
Self::read_file(path).and_then(|contents| self.run_with_scope(scope, &contents))
}
/// Evaluate a script, returning any error (if any).
#[inline(always)]
pub fn run(&self, script: &str) -> Result<(), Box<EvalAltResult>> {
self.run_with_scope(&mut Scope::new(), script)
}
}

View File

@ -7,6 +7,11 @@ use crate::{Engine, EvalAltResult, Scope, AST};
use std::prelude::v1::*;
impl Engine {
/// Evaluate a script, returning any error (if any).
#[inline(always)]
pub fn run(&self, script: &str) -> Result<(), Box<EvalAltResult>> {
self.run_with_scope(&mut Scope::new(), script)
}
/// Evaluate a script with own scope, returning any error (if any).
///
/// ## Constants Propagation