File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -1214,8 +1214,7 @@ fn inner_start_gas_snapshot(
12141214 name : Option < String > ,
12151215) -> Result {
12161216 // Revert if there is an active gas snapshot as we can only have one active snapshot at a time.
1217- if ccx. state . gas_metering . active_gas_snapshot . is_some ( ) {
1218- let ( group, name) = ccx. state . gas_metering . active_gas_snapshot . as_ref ( ) . unwrap ( ) . clone ( ) ;
1217+ if let Some ( ( group, name) ) = & ccx. state . gas_metering . active_gas_snapshot {
12191218 bail ! ( "gas snapshot was already started with group: {group} and name: {name}" ) ;
12201219 }
12211220
@@ -1241,10 +1240,9 @@ fn inner_stop_gas_snapshot(
12411240 name : Option < String > ,
12421241) -> Result {
12431242 // If group and name are not provided, use the last snapshot group and name.
1244- let ( group, name) = group. zip ( name) . unwrap_or_else ( || {
1245- let ( group, name) = ccx. state . gas_metering . active_gas_snapshot . as_ref ( ) . unwrap ( ) . clone ( ) ;
1246- ( group, name)
1247- } ) ;
1243+ let ( group, name) = group
1244+ . zip ( name)
1245+ . unwrap_or_else ( || ccx. state . gas_metering . active_gas_snapshot . clone ( ) . unwrap ( ) ) ;
12481246
12491247 if let Some ( record) = ccx
12501248 . state
You can’t perform that action at this time.
0 commit comments