Skip to content

Commit

Permalink
remove duplicate reconstruct_const functions
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-schott committed Oct 4, 2023
1 parent 4adb6a5 commit 0555ba8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions compiler/ast/src/passes/reconstructor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,14 @@ pub trait ProgramReconstructor: StatementReconstructor {
structs: input.structs.into_iter().map(|(i, c)| (i, self.reconstruct_struct(c))).collect(),
mappings: input.mappings.into_iter().map(|(id, mapping)| (id, self.reconstruct_mapping(mapping))).collect(),
functions: input.functions.into_iter().map(|(i, f)| (i, self.reconstruct_function(f))).collect(),
consts: input.consts.into_iter().map(|(i, c)| (i, self.reconstruct_const(c))).collect(),
consts: input
.consts
.into_iter()
.map(|(i, c)| match self.reconstruct_const(c) {
(Statement::Const(declaration), _) => (i, declaration),
_ => unreachable!("`reconstruct_const` can only return `Statement::Const`"),
})
.collect(),
span: input.span,
}
}
Expand Down Expand Up @@ -410,10 +417,6 @@ pub trait ProgramReconstructor: StatementReconstructor {
}
}

fn reconstruct_const(&mut self, input: ConstDeclaration) -> ConstDeclaration {
input
}

fn reconstruct_struct(&mut self, input: Struct) -> Struct {
input
}
Expand Down

0 comments on commit 0555ba8

Please sign in to comment.