1
Fork 0

Make use of [wrapping_]byte_{add,sub}

...replacing `.cast().wrapping_offset().cast()` & similar code.
This commit is contained in:
Maybe Waffle 2022-08-19 13:20:22 +04:00
parent 1cff564203
commit 53565b23ac
10 changed files with 17 additions and 18 deletions

View file

@ -650,7 +650,7 @@ fn thin_box() {
.unwrap_or_else(|| handle_alloc_error(layout))
.cast::<DynMetadata<T>>();
ptr.as_ptr().write(meta);
ptr.cast::<u8>().as_ptr().add(offset).cast::<Value>().write(value);
ptr.as_ptr().byte_add(offset).cast::<Value>().write(value);
Self { ptr, phantom: PhantomData }
}
}