diff --git a/lib/src/metta/runner/environment.rs b/lib/src/metta/runner/environment.rs index 01773fe6f..fe765d5aa 100644 --- a/lib/src/metta/runner/environment.rs +++ b/lib/src/metta/runner/environment.rs @@ -146,8 +146,8 @@ impl EnvBuilder { /// /// NOTE: The most recently added paths will have the highest search priority, save for the `working_dir`, /// and paths returned first by the iterator will have higher priority within the same call to add_include_paths. - pub fn add_include_paths, I: IntoIterator>(mut self, paths: I) -> Self { - let mut additional_paths: Vec = paths.into_iter().map(|path| path.borrow().into()).collect(); + pub fn add_include_paths, I: IntoIterator>(mut self, paths: I) -> Self { + let mut additional_paths: Vec = paths.into_iter().map(|path| path.as_ref().into()).collect(); additional_paths.extend(self.env.extra_include_paths); self.env.extra_include_paths = additional_paths; self diff --git a/lib/src/metta/runner/mod.rs b/lib/src/metta/runner/mod.rs index b84ba89f6..9f235b707 100644 --- a/lib/src/metta/runner/mod.rs +++ b/lib/src/metta/runner/mod.rs @@ -6,7 +6,6 @@ use super::space::*; use super::text::{Tokenizer, SExprParser}; use super::types::validate_atom; -use core::borrow::Borrow; use std::rc::Rc; use std::path::{Path, PathBuf}; use std::collections::HashMap; @@ -243,8 +242,8 @@ impl Metta { } /// Runs the MeTTa code in the specified file - pub fn run_from_file>(&self, program_path: P) -> Result>, String> { - let path = program_path.borrow(); + pub fn run_from_file>(&self, path: P) -> Result>, String> { + let path = path.as_ref(); let program = std::fs::read_to_string(path) .map_err(|err| format!("Could not read file, path: {}, error: {}", path.display(), err))?; self.run(SExprParser::new(program.as_str()))