diff --git a/compilers/concrete-optimizer/concrete-optimizer-cpp/src/concrete-optimizer.rs b/compilers/concrete-optimizer/concrete-optimizer-cpp/src/concrete-optimizer.rs index b195d12424..b2310cf38e 100644 --- a/compilers/concrete-optimizer/concrete-optimizer-cpp/src/concrete-optimizer.rs +++ b/compilers/concrete-optimizer/concrete-optimizer-cpp/src/concrete-optimizer.rs @@ -716,7 +716,7 @@ impl Dag { pub struct DagBuilder<'dag>(unparametrized::DagBuilder<'dag>); -impl<'dag> DagBuilder<'dag> { +impl DagBuilder<'_> { fn add_input( &mut self, out_precision: Precision, diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/dag/unparametrized.rs b/compilers/concrete-optimizer/concrete-optimizer/src/dag/unparametrized.rs index 26cd246285..c96fc2a924 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/dag/unparametrized.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/dag/unparametrized.rs @@ -128,7 +128,7 @@ impl<'dag> DagCircuit<'dag> { } } -impl<'dag> fmt::Display for DagCircuit<'dag> { +impl fmt::Display for DagCircuit<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { for op in self.get_operators_iter() { writeln!(f, "{} <- {:?}", op.id, op.operator)?; @@ -146,7 +146,7 @@ pub struct DagBuilder<'dag> { pub(crate) circuit: String, } -impl<'dag> DagBuilder<'dag> { +impl DagBuilder<'_> { fn add_operator(&mut self, operator: Operator, location: Location) -> OperatorIndex { debug_assert!(operator .get_inputs_iter() diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/analyze.rs b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/analyze.rs index e4d6115897..9cdb338447 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/analyze.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/analyze.rs @@ -56,7 +56,7 @@ pub struct VariancedDagOperator<'a> { id: OperatorIndex, } -impl<'a> VariancedDagOperator<'a> { +impl VariancedDagOperator<'_> { #[allow(unused)] fn get_inputs_iter(&self) -> impl Iterator> { self.operator() @@ -66,7 +66,7 @@ impl<'a> VariancedDagOperator<'a> { .map(|n| self.dag.get_operator(n.id)) } - pub(crate) fn operator(&self) -> DagOperator<'a> { + pub(crate) fn operator(&self) -> DagOperator<'_> { self.dag.dag.get_operator(self.id) } @@ -85,7 +85,7 @@ pub struct VariancedDagOperatorMut<'a> { id: OperatorIndex, } -impl<'a> VariancedDagOperatorMut<'a> { +impl VariancedDagOperatorMut<'_> { fn get_inputs_iter(&self) -> impl Iterator> { self.operator() .get_inputs_iter() diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/keys_spec.rs b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/keys_spec.rs index f2c0626a64..b28c45897c 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/keys_spec.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/keys_spec.rs @@ -711,9 +711,9 @@ impl InstructionKeys { } pub fn shared_keys(instructions_keys: &[Self], sharing: &KeySharing) -> Vec { - return instructions_keys + instructions_keys .iter() .map(|i| i.shared_keys_1(sharing)) - .collect(); + .collect() } } diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/optimize/restriction.rs b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/optimize/restriction.rs index 8d0f8a5cec..aea75f68bc 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/optimize/restriction.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/optimize/restriction.rs @@ -348,10 +348,10 @@ pub struct KeysetRestriction { impl SearchSpaceRestriction for KeysetRestriction { fn is_available_glwe(&self, _partition: PartitionIndex, glwe_params: GlweParameters) -> bool { - return self.info.lwe_bootstrap_keys.iter().any(|k| { + self.info.lwe_bootstrap_keys.iter().any(|k| { k.glwe_dimension == glwe_params.glwe_dimension && k.polynomial_size == 2_u64.pow(glwe_params.log2_polynomial_size as u32) - }); + }) } fn is_available_macro( @@ -359,12 +359,12 @@ impl SearchSpaceRestriction for KeysetRestriction { _partition: PartitionIndex, macro_parameters: MacroParameters, ) -> bool { - return self.info.lwe_bootstrap_keys.iter().any(|k| { + self.info.lwe_bootstrap_keys.iter().any(|k| { k.glwe_dimension == macro_parameters.glwe_params.glwe_dimension && k.polynomial_size == 2_u64.pow(macro_parameters.glwe_params.log2_polynomial_size as u32) && k.input_lwe_dimension == macro_parameters.internal_dim - }); + }) } fn is_available_micro_pbs( @@ -373,14 +373,14 @@ impl SearchSpaceRestriction for KeysetRestriction { macro_parameters: MacroParameters, pbs_parameters: BrDecompositionParameters, ) -> bool { - return self.info.lwe_bootstrap_keys.iter().any(|k| { + self.info.lwe_bootstrap_keys.iter().any(|k| { k.glwe_dimension == macro_parameters.glwe_params.glwe_dimension && k.polynomial_size == 2_u64.pow(macro_parameters.glwe_params.log2_polynomial_size as u32) && k.input_lwe_dimension == macro_parameters.internal_dim && k.level_count == pbs_parameters.level && k.base_log == pbs_parameters.log2_base - }); + }) } fn is_available_micro_ks( @@ -391,12 +391,12 @@ impl SearchSpaceRestriction for KeysetRestriction { to_macro: MacroParameters, ks_parameters: KsDecompositionParameters, ) -> bool { - return self.info.lwe_keyswitch_keys.iter().any(|k| { + self.info.lwe_keyswitch_keys.iter().any(|k| { k.input_lwe_dimension == from_macro.glwe_params.sample_extract_lwe_dimension() && k.output_lwe_dimension == to_macro.internal_dim && k.level_count == ks_parameters.level && k.base_log == ks_parameters.log2_base - }); + }) } fn is_available_micro_fks( @@ -407,12 +407,12 @@ impl SearchSpaceRestriction for KeysetRestriction { to_macro: MacroParameters, ks_parameters: KsDecompositionParameters, ) -> bool { - return self.info.lwe_keyswitch_keys.iter().any(|k| { + self.info.lwe_keyswitch_keys.iter().any(|k| { k.input_lwe_dimension == from_macro.glwe_params.sample_extract_lwe_dimension() && k.output_lwe_dimension == to_macro.glwe_params.sample_extract_lwe_dimension() && k.level_count == ks_parameters.level && k.base_log == ks_parameters.log2_base - }); + }) } } diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/utils/viz.rs b/compilers/concrete-optimizer/concrete-optimizer/src/utils/viz.rs index c42f9ad303..0e726f9dd3 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/utils/viz.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/utils/viz.rs @@ -47,7 +47,7 @@ impl Viz for crate::dag::unparametrized::Dag { } } -impl<'dag> Viz for crate::dag::unparametrized::DagCircuit<'dag> { +impl Viz for crate::dag::unparametrized::DagCircuit<'_> { fn viz_node(&self) -> String { let mut graph: Vec = vec![]; let circuit = &self.circuit; @@ -72,7 +72,7 @@ style=\"rounded\" } } -impl<'dag> Viz for crate::dag::unparametrized::DagOperator<'dag> { +impl Viz for crate::dag::unparametrized::DagOperator<'_> { fn viz_node(&self) -> String { let input_string = self .operator