mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Rustfmt + build fix.
This commit is contained in:
parent
f429c28f23
commit
db2f6aa8ca
9 changed files with 33 additions and 28 deletions
|
@ -21,7 +21,7 @@ const ARC_SLICE_CANARY: u32 = 0xf3f3f3f3;
|
|||
/// cbindgen:derive-eq=false
|
||||
/// cbindgen:derive-neq=false
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, ToShmem)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq, ToShmem)]
|
||||
pub struct ArcSlice<T>(#[shmem(field_bound)] ThinArc<u32, T>);
|
||||
|
||||
impl<T> Deref for ArcSlice<T> {
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
|
||||
//! A replacement for `Box<[T]>` that cbindgen can understand.
|
||||
|
||||
use malloc_size_of::{MallocShallowSizeOf, MallocSizeOf, MallocSizeOfOps};
|
||||
use std::marker::PhantomData;
|
||||
use std::{fmt, mem, slice};
|
||||
use std::ptr::NonNull;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use malloc_size_of::{MallocSizeOf, MallocShallowSizeOf, MallocSizeOfOps};
|
||||
use std::ptr::NonNull;
|
||||
use std::{fmt, mem, slice};
|
||||
use to_shmem::{SharedMemoryBuilder, ToShmem};
|
||||
|
||||
/// A struct that basically replaces a `Box<[T]>`, but which cbindgen can
|
||||
|
@ -86,9 +86,7 @@ impl<T: Sized> OwnedSlice<T> {
|
|||
/// Convert the OwnedSlice into a Vec.
|
||||
#[inline]
|
||||
pub fn into_vec(self) -> Vec<T> {
|
||||
let ret = unsafe {
|
||||
Vec::from_raw_parts(self.ptr.as_ptr(), self.len, self.len)
|
||||
};
|
||||
let ret = unsafe { Vec::from_raw_parts(self.ptr.as_ptr(), self.len, self.len) };
|
||||
mem::forget(self);
|
||||
ret
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue