File tree 1 file changed +3
-7
lines changed
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -422,13 +422,9 @@ impl AllocationsContext {
422
422
pages : WasmPagesAmount ,
423
423
charge_gas_for_grow : impl FnOnce ( WasmPagesAmount ) -> Result < ( ) , ChargeError > ,
424
424
) -> Result < WasmPage , AllocError > {
425
- let heap = match self . heap {
426
- Some ( heap) => heap,
427
-
428
- // Empty heap means that all memory is static, then no pages can be allocated.
429
- // NOTE: returns an error even if `pages` == 0.
430
- None => return Err ( AllocError :: ProgramAllocOutOfBounds ) ,
431
- } ;
425
+ // Empty heap means that all memory is static, then no pages can be allocated.
426
+ // NOTE: returns an error even if `pages` == 0.
427
+ let heap = self . heap . ok_or ( Err ( AllocError :: ProgramAllocOutOfBounds ) ) ?;
432
428
433
429
// If trying to allocate zero pages, then returns heap start page (legacy).
434
430
if pages == WasmPage :: from ( 0 ) {
You can’t perform that action at this time.
0 commit comments