Skip to content

Commit

Permalink
chore: remove unwanted index accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
kobyhallx committed Dec 1, 2023
1 parent be73d50 commit 40b8324
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion compiler/noirc_frontend/src/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl Context {
}

/// Returns the [Location] of the definition of the given Ident found at [Span]
/// Return [None] when definition is not found.
/// Returns [None] when definition is not found.
pub fn find_definition_location(
&self,
file: FileId,
Expand Down
15 changes: 3 additions & 12 deletions compiler/noirc_frontend/src/node_interner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,6 @@ impl DefinitionInfo {
pub fn is_global(&self) -> bool {
self.kind.is_global()
}

pub fn get_index(&self) -> Option<Index> {
match self.kind {
DefinitionKind::Function(func_id) => Some(func_id.0),
DefinitionKind::Global(stmt_id) => Some(stmt_id.0),
DefinitionKind::Local(expr_id) => expr_id.map(|id| Some(id.0)).unwrap_or(None),
DefinitionKind::GenericType(_) => None,
}
}
}

#[derive(Debug, Clone, Eq, PartialEq)]
Expand Down Expand Up @@ -1221,10 +1212,10 @@ impl NodeInterner {
self.selected_trait_implementations.get(&ident_id).cloned()
}

pub fn resolve_location(&self, index: &Index) -> Option<Location> {
self.nodes.get(*index).and_then(|def| match def {
pub fn resolve_location(&self, index_id: &Index) -> Option<Location> {
self.nodes.get(*index_id).and_then(|def| match def {
Node::Function(func) => {
self.resolve_location(&func.as_expr().0)
self.resolve_location(&func.as_expr().into())
}
Node::Expression(expression) => {
match expression {
Expand Down

0 comments on commit 40b8324

Please sign in to comment.