diff --git a/src/plonk/circuit.rs b/src/plonk/circuit.rs index 895cd8a..b5d7f4e 100644 --- a/src/plonk/circuit.rs +++ b/src/plonk/circuit.rs @@ -87,12 +87,10 @@ impl TryFrom> for Column { fn try_from(any: Column) -> Result { match any.column_type() { - Any::Advice => { - return Ok(Column { - index: any.index(), - column_type: Advice, - }) - } + Any::Advice => Ok(Column { + index: any.index(), + column_type: Advice, + }), _ => Err("Cannot convert into Column"), } } @@ -103,12 +101,10 @@ impl TryFrom> for Column { fn try_from(any: Column) -> Result { match any.column_type() { - Any::Fixed => { - return Ok(Column { - index: any.index(), - column_type: Fixed, - }) - } + Any::Fixed => Ok(Column { + index: any.index(), + column_type: Fixed, + }), _ => Err("Cannot convert into Column"), } } @@ -119,12 +115,10 @@ impl TryFrom> for Column { fn try_from(any: Column) -> Result { match any.column_type() { - Any::Aux => { - return Ok(Column { - index: any.index(), - column_type: Aux, - }) - } + Any::Aux => Ok(Column { + index: any.index(), + column_type: Aux, + }), _ => Err("Cannot convert into Column"), } } @@ -495,7 +489,7 @@ impl ConstraintSystem { } pub(crate) fn get_any_query_index(&self, column: Column, at: i32) -> usize { - let index = match column.column_type() { + match column.column_type() { Any::Advice => { self.get_advice_query_index(Column::::try_from(column).unwrap(), at) } @@ -503,9 +497,7 @@ impl ConstraintSystem { self.get_fixed_query_index(Column::::try_from(column).unwrap(), at) } Any::Aux => self.get_aux_query_index(Column::::try_from(column).unwrap(), at), - }; - - index + } } /// Create a new gate