diff options
author | Simon THOBY <git@nightmared.fr> | 2023-03-18 19:43:19 +0000 |
---|---|---|
committer | Simon THOBY <git@nightmared.fr> | 2023-03-18 19:43:19 +0000 |
commit | c7f10198124c829b1869c406071f59136fb0737d (patch) | |
tree | f4893225bd305fb2b152bcd753d75d24c2ef4802 /src/batch.rs | |
parent | d5b9ec5185a27414286ee303eb3d21ce3069db09 (diff) | |
parent | 050453d0e63553e80e695579efdfeb183ab1aa7b (diff) |
Merge branch 'nightmared-small-improvements' into 'master'
Fix the doc.rs generation
Closes #6
See merge request rustwall/rustables!17
Diffstat (limited to 'src/batch.rs')
-rw-r--r-- | src/batch.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/batch.rs b/src/batch.rs index b5c88b8..980194b 100644 --- a/src/batch.rs +++ b/src/batch.rs @@ -33,6 +33,7 @@ impl Batch { pub fn new() -> Self { // TODO: use a pinned Box ? let mut buf = Box::new(Vec::with_capacity(default_batch_page_size() as usize)); + // Safe because we hold onto the buffer for as long as `writer` exists let mut writer = NfNetlinkWriter::new(unsafe { std::mem::transmute(Box::as_mut(&mut buf) as *mut Vec<u8>) }); |