Change to circuit_name in internal variables

This commit is contained in:
howardwu 2020-06-20 01:18:53 -07:00
parent c9d3f8615e
commit 88c0feb334
2 changed files with 4 additions and 7 deletions

View File

@ -11,17 +11,14 @@ pub struct Circuit {
impl<'ast> From<AstCircuit<'ast>> for Circuit {
fn from(circuit: AstCircuit<'ast>) -> Self {
let variable = Identifier::from(circuit.identifier);
let circuit_name = Identifier::from(circuit.identifier);
let members = circuit
.members
.into_iter()
.map(|member| CircuitMember::from(member))
.collect();
Self {
circuit_name: variable,
members,
}
Self { circuit_name, members }
}
}

View File

@ -161,14 +161,14 @@ impl<'ast> fmt::Display for Expression {
impl<'ast> From<CircuitInlineExpression<'ast>> for Expression {
fn from(expression: CircuitInlineExpression<'ast>) -> Self {
let variable = Identifier::from(expression.identifier);
let circuit_name = Identifier::from(expression.identifier);
let members = expression
.members
.into_iter()
.map(|member| CircuitFieldDefinition::from(member))
.collect::<Vec<CircuitFieldDefinition>>();
Expression::Circuit(variable, members)
Expression::Circuit(circuit_name, members)
}
}