(&mut self, val: &[u8])
| 237 | } |
| 238 | |
| 239 | fn write_bytes(&mut self, val: &[u8]) { |
| 240 | let mmap = self.mmap.as_mut().expect("write before reserve"); |
| 241 | // SAFETY: the `mmap` has not be made readonly yet so it should |
| 242 | // be safe to mutate it. |
| 243 | unsafe { |
| 244 | mmap.as_mut_slice()[self.len..][..val.len()].copy_from_slice(val); |
| 245 | } |
| 246 | self.len += val.len(); |
| 247 | } |
| 248 | } |
| 249 | } |
| 250 | } |
no test coverage detected