End a region of patchable code, yielding a [`PatchRegion`] value that can be consumed later to produce a one-off mutable slice to the associated region of the data buffer.
(&mut self, open: OpenPatchRegion)
| 623 | /// can be consumed later to produce a one-off mutable slice to the |
| 624 | /// associated region of the data buffer. |
| 625 | pub fn end_patchable(&mut self, open: OpenPatchRegion) -> PatchRegion { |
| 626 | // No need to assert the state of `open_patchable` here, as we take |
| 627 | // ownership of the only `OpenPatchable` value. |
| 628 | self.open_patchable = false; |
| 629 | let end = usize::try_from(self.cur_offset()).unwrap(); |
| 630 | PatchRegion { range: open.0..end } |
| 631 | } |
| 632 | |
| 633 | /// Allocate a `Label` to refer to some offset. May not be bound to a fixed |
| 634 | /// offset yet. |
no test coverage detected