(self)
| 535 | |
| 536 | #[inline] |
| 537 | pub(super) fn into_buffer(self) -> Buffer { |
| 538 | let bytes = unsafe { Bytes::new(self.data, self.len, Deallocation::Standard(self.layout)) }; |
| 539 | #[cfg(feature = "pool")] |
| 540 | { |
| 541 | let reservation = self.reservation.lock().unwrap().take(); |
| 542 | *bytes.reservation.lock().unwrap() = reservation; |
| 543 | } |
| 544 | std::mem::forget(self); |
| 545 | Buffer::from(bytes) |
| 546 | } |
| 547 | |
| 548 | /// View this buffer as a mutable slice of a specific type. |
| 549 | /// |