Skip to content

Commit

Permalink
Simplify resolve_symbol_and_mod_path.
Browse files Browse the repository at this point in the history
  • Loading branch information
tritao committed Nov 28, 2024
1 parent b699101 commit d834be3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sway-core/src/semantic_analysis/type_resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ pub fn resolve_call_path(
.cloned()
.collect();

let (decl, mod_path) = resolve_symbol_and_mod_path(
let decl = resolve_symbol(
handler,
engines,
&root.module,
Expand Down Expand Up @@ -333,14 +333,14 @@ pub fn resolve_call_path(
Ok(decl)
}

fn resolve_symbol_and_mod_path(
fn resolve_symbol(
handler: &Handler,
engines: &Engines,
module: &Module,
mod_path: &ModulePath,
symbol: &Ident,
self_type: Option<TypeId>,
) -> Result<(ResolvedDeclaration, Vec<Ident>), ErrorEmitted> {
) -> Result<ResolvedDeclaration, ErrorEmitted> {
let mut current_module = module;
// This block tries to resolve associated types
let mut current_mod_path = vec![];
Expand Down Expand Up @@ -383,7 +383,7 @@ fn resolve_symbol_and_mod_path(
None,
self_type,
)?;
return Ok((decl, current_mod_path));
return Ok(decl);
}

module
Expand All @@ -393,7 +393,7 @@ fn resolve_symbol_and_mod_path(
.current_lexical_scope()
.items
.resolve_symbol(handler, engines, symbol)?;
Ok((decl, mod_path.to_vec()))
Ok(decl)
})
}

Expand Down

0 comments on commit d834be3

Please sign in to comment.