Use Ident.
This commit is contained in:
@@ -591,7 +591,7 @@ pub fn search_imports<'s>(
|
||||
state: &mut State,
|
||||
modules: &ModuleRef,
|
||||
) -> Result<&'s Module, Box<EvalAltResult>> {
|
||||
let (root, root_pos) = &modules[0];
|
||||
let Ident { name: root, pos } = &modules[0];
|
||||
|
||||
// Qualified - check if the root module is directly indexed
|
||||
let index = if state.always_search {
|
||||
@@ -608,7 +608,7 @@ pub fn search_imports<'s>(
|
||||
.rev()
|
||||
.find(|(n, _)| n == root)
|
||||
.map(|(_, m)| m)
|
||||
.ok_or_else(|| EvalAltResult::ErrorModuleNotFound(root.to_string(), *root_pos))?
|
||||
.ok_or_else(|| EvalAltResult::ErrorModuleNotFound(root.to_string(), *pos))?
|
||||
})
|
||||
}
|
||||
|
||||
@@ -619,7 +619,7 @@ pub fn search_imports_mut<'s>(
|
||||
state: &mut State,
|
||||
modules: &ModuleRef,
|
||||
) -> Result<&'s mut Module, Box<EvalAltResult>> {
|
||||
let (root, root_pos) = &modules[0];
|
||||
let Ident { name: root, pos } = &modules[0];
|
||||
|
||||
// Qualified - check if the root module is directly indexed
|
||||
let index = if state.always_search {
|
||||
@@ -636,7 +636,7 @@ pub fn search_imports_mut<'s>(
|
||||
.rev()
|
||||
.find(|(n, _)| n == root)
|
||||
.map(|(_, m)| m)
|
||||
.ok_or_else(|| EvalAltResult::ErrorModuleNotFound(root.to_string(), *root_pos))?
|
||||
.ok_or_else(|| EvalAltResult::ErrorModuleNotFound(root.to_string(), *pos))?
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user