clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
e3501427d8
commit
9bd083764a
@ -16,7 +16,7 @@ pub fn buffer<T: Sized>() -> Vec<u8> {
|
|||||||
let capacity = capacity::<T>();
|
let capacity = capacity::<T>();
|
||||||
unsafe {
|
unsafe {
|
||||||
let data = std::alloc::alloc(std::alloc::Layout::array::<u8>(capacity).unwrap());
|
let data = std::alloc::alloc(std::alloc::Layout::array::<u8>(capacity).unwrap());
|
||||||
Vec::from_raw_parts(data as *mut u8, capacity, capacity)
|
Vec::from_raw_parts(data, capacity, capacity)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ pub mod vec {
|
|||||||
pub unsafe fn uninitialized(len: usize) -> Vec<u8> {
|
pub unsafe fn uninitialized(len: usize) -> Vec<u8> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let data = std::alloc::alloc(std::alloc::Layout::array::<u8>(len).unwrap());
|
let data = std::alloc::alloc(std::alloc::Layout::array::<u8>(len).unwrap());
|
||||||
Vec::from_raw_parts(data as *mut u8, len, len)
|
Vec::from_raw_parts(data, len, len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user