aboutsummaryrefslogtreecommitdiffstats
path: root/components/style_traits
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-05-09 19:12:32 +0200
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-05-10 12:43:06 +0200
commitdb2f6aa8ca1f23f78a497cb7cc960ff99f23ac04 (patch)
tree58fae3d37299c0986141ba88a106066716a518a1 /components/style_traits
parentf429c28f23bb21812deb042bf50e4bf16b9e1f1b (diff)
downloadservo-db2f6aa8ca1f23f78a497cb7cc960ff99f23ac04.tar.gz
servo-db2f6aa8ca1f23f78a497cb7cc960ff99f23ac04.zip
style: Rustfmt + build fix.
Diffstat (limited to 'components/style_traits')
-rw-r--r--components/style_traits/arc_slice.rs2
-rw-r--r--components/style_traits/owned_slice.rs10
2 files changed, 5 insertions, 7 deletions
diff --git a/components/style_traits/arc_slice.rs b/components/style_traits/arc_slice.rs
index f7097e3d086..dd1b99d3424 100644
--- a/components/style_traits/arc_slice.rs
+++ b/components/style_traits/arc_slice.rs
@@ -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> {
diff --git a/components/style_traits/owned_slice.rs b/components/style_traits/owned_slice.rs
index 6e54aaeef5f..f2b0de4a4a0 100644
--- a/components/style_traits/owned_slice.rs
+++ b/components/style_traits/owned_slice.rs
@@ -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
}