use parent() instead of ancestors().next() in load_context_directory()
This commit is contained in:
@@ -1270,8 +1270,11 @@ impl Machine {
|
||||
|
||||
pub(crate) fn load_context_directory(&mut self) {
|
||||
if let Some(load_context) = self.load_contexts.last() {
|
||||
if let Some(directory) = load_context.path.ancestors().next() {
|
||||
if let Some(directory) = load_context.path.parent() {
|
||||
// canonicalize returns the absolute path of the directory.
|
||||
let directory = directory.canonicalize().unwrap();
|
||||
let directory_str = directory.to_str().unwrap();
|
||||
|
||||
let directory_atom =
|
||||
clause_name!(directory_str.to_string(), self.machine_st.atom_tbl);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user