@@ -40,7 +40,7 @@ impl ParametersUpdater {
4040 }
4141
4242 fn cw_u32 ( & mut self , f : impl Fn ( & mut ConwayParams ) -> & mut u32 , u : & Option < u64 > ) -> Result < ( ) > {
43- self . cw_upd ( f, & u. map ( |x| u32:: try_from ( x ) ) . transpose ( ) ?)
43+ self . cw_upd ( f, & u. map ( u32:: try_from) . transpose ( ) ?)
4444 }
4545
4646 fn update_conway_params ( & mut self , p : & ProtocolParamUpdate ) -> Result < ( ) > {
@@ -129,7 +129,7 @@ impl ParametersUpdater {
129129 f : impl Fn ( & mut ShelleyProtocolParams ) -> & mut u32 ,
130130 u : & Option < u64 > ,
131131 ) -> Result < ( ) > {
132- self . sh_upd ( f, & u. map ( |x| u32:: try_from ( x ) ) . transpose ( ) ?)
132+ self . sh_upd ( f, & u. map ( u32:: try_from) . transpose ( ) ?)
133133 }
134134
135135 fn update_shelley_params ( & mut self , p : & ProtocolParamUpdate ) -> Result < ( ) > {
@@ -185,7 +185,7 @@ impl ParametersUpdater {
185185 }
186186
187187 fn a_u32 ( & mut self , f : impl Fn ( & mut AlonzoParams ) -> & mut u32 , u : & Option < u64 > ) -> Result < ( ) > {
188- self . a_upd ( f, & u. map ( |x| u32:: try_from ( x ) ) . transpose ( ) ?)
188+ self . a_upd ( f, & u. map ( u32:: try_from) . transpose ( ) ?)
189189 }
190190
191191 fn update_alonzo_params ( & mut self , p : & ProtocolParamUpdate ) -> Result < ( ) > {
@@ -215,7 +215,7 @@ impl ParametersUpdater {
215215
216216 fn update_committee ( c : & mut Committee , cu : & CommitteeChange ) {
217217 for removed_member in cu. removed_committee_members . iter ( ) {
218- if let None = c. members . remove ( removed_member) {
218+ if c. members . remove ( removed_member) . is_none ( ) {
219219 error ! (
220220 "Removing {:?}, which is not a part of the committee" ,
221221 removed_member
@@ -231,7 +231,7 @@ impl ParametersUpdater {
231231 ) ;
232232 }
233233 }
234- c. threshold = cu. terms . clone ( ) ;
234+ c. threshold = cu. terms ;
235235 }
236236
237237 fn apply_alonzo_babbage_outcome_elem ( & mut self , u : & AlonzoBabbageVotingOutcome ) -> Result < ( ) > {
@@ -242,14 +242,14 @@ impl ParametersUpdater {
242242 }
243243
244244 fn apply_enact_state_elem ( & mut self , u : & EnactStateElem ) -> Result < ( ) > {
245- let ref mut c = self
245+ let c = & mut ( self
246246 . params
247247 . conway
248248 . as_mut ( )
249- . ok_or_else ( || anyhow ! ( "Conway must present for enact state" ) ) ?;
249+ . ok_or_else ( || anyhow ! ( "Conway must present for enact state" ) ) ?) ;
250250
251251 match & u {
252- EnactStateElem :: Params ( pu) => self . update_params ( & pu) ?,
252+ EnactStateElem :: Params ( pu) => self . update_params ( pu) ?,
253253 EnactStateElem :: Constitution ( cu) => c. constitution = cu. clone ( ) ,
254254 EnactStateElem :: Committee ( cu) => Self :: update_committee ( & mut c. committee , cu) ,
255255 EnactStateElem :: NoConfidence => c. committee . members . clear ( ) ,
0 commit comments