From fa41f4faf0f2d2718f14a692f17dab38d9d4e08e Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sat, 20 Nov 2021 15:43:55 +0800 Subject: [PATCH] Move function back to correct file. --- src/api/files.rs | 5 ----- src/api/run.rs | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/api/files.rs b/src/api/files.rs index 70bcff02..36d7872f 100644 --- a/src/api/files.rs +++ b/src/api/files.rs @@ -193,9 +193,4 @@ impl Engine { ) -> Result<(), Box> { 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> { - self.run_with_scope(&mut Scope::new(), script) - } } diff --git a/src/api/run.rs b/src/api/run.rs index 7777b2ca..9a0ec620 100644 --- a/src/api/run.rs +++ b/src/api/run.rs @@ -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> { + self.run_with_scope(&mut Scope::new(), script) + } /// Evaluate a script with own scope, returning any error (if any). /// /// ## Constants Propagation