The UFZ services GitLab and Mattermost will be unavailable on Monday, July 4 from 06:00 AM to 08:00 AM due to maintenance work.

Commit 258494da authored by Adam Reichold's avatar Adam Reichold
Browse files

Use a slightly more robust code pattern for restoring boxed slices.

parent 9715d45c
Pipeline #77376 passed with stage
in 6 minutes and 12 seconds
use std::io::IoSlice;
use std::mem::{align_of, size_of, transmute};
use std::mem::{align_of, size_of};
use std::ptr::{addr_of_mut, write};
use std::slice::from_raw_parts;
use std::slice::{from_raw_parts, from_raw_parts_mut};
use model::{
bumblebee::{Bumblebee, Colony},
......@@ -197,7 +197,7 @@ where
let len = (*this).len();
let (ptr, rest) = restore_many::<T>(len, buf);
let vals = transmute(from_raw_parts(ptr, len));
let vals = Box::from_raw(from_raw_parts_mut(ptr, len));
write(this, vals);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment