Skip to content

Commit

Permalink
chore: fmt + clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
guorong009 committed Jun 12, 2024
1 parent ba526ef commit 0690751
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 32 deletions.
35 changes: 7 additions & 28 deletions halo2_frontend/src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1378,11 +1378,8 @@ mod tests {
// If q is enabled, a must be in the table.
// If `s_ltable` is enabled, the value of `advice_table` & `table` is used as lookup table.
vec![
(
q.clone() * a.clone(),
table * s_ltable.clone(),
),
(q.clone() * a , advice_table * s_ltable.clone()),
(q.clone() * a.clone(), table * s_ltable.clone()),
(q.clone() * a, advice_table * s_ltable.clone()),
(q, s_ltable),
]
});
Expand Down Expand Up @@ -1531,10 +1528,7 @@ mod tests {

// If q is enabled, a must be in the table.
vec![
(
q.clone() * a.clone(),
s_ltable.clone() * table,
),
(q.clone() * a.clone(), s_ltable.clone() * table),
(q * a, s_ltable * advice_table),
]
});
Expand Down Expand Up @@ -1572,9 +1566,7 @@ mod tests {
}

#[test]
#[should_panic(
expected = "table expression need selector/fixed query(column) for tagging"
)]
#[should_panic(expected = "table expression need selector/fixed query(column) for tagging")]
fn bad_lookup_any_no_fixed_col_or_selector() {
const K: u32 = 4;

Expand Down Expand Up @@ -1613,13 +1605,7 @@ mod tests {
let table = cells.query_instance(table, Rotation::cur());

// If q is enabled, a must be in the table.
vec![
(
q.clone() * a.clone(),
table,
),
(q * a, advice_table),
]
vec![(q.clone() * a.clone(), table), (q * a, advice_table)]
});

FaultyCircuitConfig {
Expand Down Expand Up @@ -1700,11 +1686,7 @@ mod tests {
Self {}
}

fn synthesize(
&self,
_: Self::Config,
_: impl Layouter<Fp>,
) -> Result<(), Error> {
fn synthesize(&self, _: Self::Config, _: impl Layouter<Fp>) -> Result<(), Error> {
unreachable!("Should not be called because of configuration error");
}
}
Expand Down Expand Up @@ -1766,10 +1748,7 @@ mod tests {
// If q is enabled, a must be in the table.
// If `s_ltable` is enabled, the value of `advice_table` & `table` is used as lookup table.
vec![
(
q.clone() * a.clone(),
table * s_ltable.clone(),
),
(q.clone() * a.clone(), table * s_ltable.clone()),
(q.clone() * a, advice_table * s_ltable.clone()),
(q, s_ltable),
]
Expand Down
6 changes: 2 additions & 4 deletions halo2_frontend/src/plonk/circuit/constraint_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,10 @@ impl<F: Field> ConstraintSystem<F> {
if is_all_table_expr_fixed_or_selector {
panic!("all table expressions contain only fixed query(column), should use `lookup` api instead of `lookup_any`");
}
if !is_all_input_expr_contains_fixed_or_selector
{
if !is_all_input_expr_contains_fixed_or_selector {
panic!("input expression need selector/fixed query(column) for tagging");
}
if !is_all_table_expr_contains_fixed_or_selector
{
if !is_all_table_expr_contains_fixed_or_selector {
panic!("table expression need selector/fixed query(column) for tagging");
}
if !is_selector_pair_exists {
Expand Down

0 comments on commit 0690751

Please sign in to comment.