@@ -127,9 +127,8 @@ impl LogpError for PyLogpError {
127127 let Ok ( attr) = err. value ( py) . getattr ( "is_recoverable" ) else {
128128 return false ;
129129 } ;
130- return attr
131- . is_truthy ( )
132- . expect ( "Could not access is_recoverable in error check" ) ;
130+ attr. is_truthy ( )
131+ . expect ( "Could not access is_recoverable in error check" )
133132 } ) ,
134133 Self :: ReturnTypeError ( ) => false ,
135134 Self :: NotContiguousError ( _) => false ,
@@ -151,7 +150,7 @@ impl PyDensity {
151150 transform_adapter : Option < & PyTransformAdapt > ,
152151 ) -> Result < Self > {
153152 let logp_func = Python :: with_gil ( |py| logp_clone_func. call0 ( py) ) ?;
154- let transform_adapter = transform_adapter. map ( |val| val . clone ( ) ) ;
153+ let transform_adapter = transform_adapter. cloned ( ) ;
155154 Ok ( Self {
156155 logp : logp_func,
157156 transform_adapter,
@@ -185,7 +184,7 @@ impl CpuLogpFunc for PyDensity {
185184 ) ;
186185 Ok ( logp_val)
187186 }
188- Err ( err) => return Err ( PyLogpError :: PyError ( err) ) ,
187+ Err ( err) => Err ( PyLogpError :: PyError ( err) ) ,
189188 }
190189 } )
191190 }
@@ -359,7 +358,7 @@ impl TensorShape {
359358 Self { shape, dims, size }
360359 }
361360 pub fn size ( & self ) -> usize {
362- return self . size ;
361+ self . size
363362 }
364363}
365364
@@ -617,14 +616,14 @@ impl Model for PyModel {
617616 settings : & ' model S ,
618617 ) -> Result < Self :: DrawStorage < ' model , S > > {
619618 let draws = settings. hint_num_tune ( ) + settings. hint_num_draws ( ) ;
620- Ok ( PyTrace :: new (
619+ PyTrace :: new (
621620 rng,
622621 chain_id,
623622 self . variables . clone ( ) ,
624623 & self . make_expand_func ,
625624 draws,
626625 )
627- . context ( "Could not create PyTrace object" ) ? )
626+ . context ( "Could not create PyTrace object" )
628627 }
629628
630629 fn math ( & self ) -> Result < Self :: Math < ' _ > > {
0 commit comments