1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00
This commit is contained in:
schaeff 2021-08-04 23:00:10 +02:00
parent dd126b63e0
commit ea0594035a
2 changed files with 4 additions and 8 deletions

View file

@ -738,7 +738,7 @@ mod tests {
assert_eq!(
UintOptimizer::new()
.fold_uint_expression(UExpression::right_shift(left.clone(), right.clone())),
.fold_uint_expression(UExpression::right_shift(left.clone(), right)),
UExpression::right_shift(left_expected, right_expected).with_max(output_max)
);
}
@ -761,7 +761,7 @@ mod tests {
assert_eq!(
UintOptimizer::new()
.fold_uint_expression(UExpression::left_shift(left.clone(), right.clone())),
.fold_uint_expression(UExpression::left_shift(left.clone(), right)),
UExpression::left_shift(left_expected, right_expected).with_max(output_max)
);
}

View file

@ -2062,8 +2062,7 @@ impl<'ast, T: Field> Constant for ArrayExpression<'ast, T> {
.collect::<Vec<_>>()
.into(),
)
.annotate(*array_ty.ty, array_ty.size)
.into(),
.annotate(*array_ty.ty, array_ty.size),
ArrayExpressionInner::Slice(box a, box from, box to) => {
let from = match from.into_inner() {
UExpressionInner::Value(from) => from as usize,
@ -2091,7 +2090,6 @@ impl<'ast, T: Field> Constant for ArrayExpression<'ast, T> {
.into(),
)
.annotate(*array_ty.ty, array_ty.size)
.into()
}
ArrayExpressionInner::Repeat(box e, box count) => {
let count = match count.into_inner() {
@ -2105,7 +2103,6 @@ impl<'ast, T: Field> Constant for ArrayExpression<'ast, T> {
vec![TypedExpressionOrSpread::Expression(e); count].into(),
)
.annotate(*array_ty.ty, array_ty.size)
.into()
}
_ => unreachable!(),
}
@ -2130,8 +2127,7 @@ impl<'ast, T: Field> Constant for StructExpression<'ast, T> {
.map(|e| e.into_canonical_constant())
.collect(),
)
.annotate(struct_ty)
.into(),
.annotate(struct_ty),
_ => unreachable!(),
}
}