Merge use.

This commit is contained in:
Stephen Chung
2022-04-13 10:35:10 +08:00
parent c5015d5e86
commit 7788e1058a
10 changed files with 32 additions and 43 deletions

View File

@@ -4,6 +4,7 @@ use crate::{
Dynamic, Engine, EvalAltResult, Expression, FnPtr, ImmutableString, NativeCallContext,
Position, RhaiResult, RhaiResultOf, Scope, AST,
};
use std::path::PathBuf;
#[cfg(feature = "no_std")]
use std::prelude::v1::*;
@@ -22,7 +23,7 @@ impl Engine {
#[cfg(not(feature = "no_std"))]
#[cfg(not(target_family = "wasm"))]
#[inline(always)]
pub fn consume_file(&self, path: std::path::PathBuf) -> RhaiResultOf<()> {
pub fn consume_file(&self, path: PathBuf) -> RhaiResultOf<()> {
self.run_file(path)
}
@@ -40,11 +41,7 @@ impl Engine {
#[cfg(not(feature = "no_std"))]
#[cfg(not(target_family = "wasm"))]
#[inline(always)]
pub fn consume_file_with_scope(
&self,
scope: &mut Scope,
path: std::path::PathBuf,
) -> RhaiResultOf<()> {
pub fn consume_file_with_scope(&self, scope: &mut Scope, path: PathBuf) -> RhaiResultOf<()> {
self.run_file_with_scope(scope, path)
}