aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/servo_arc/lib.rs15
-rw-r--r--components/style/gecko/conversions.rs6
-rw-r--r--components/style/gecko/values.rs2
-rw-r--r--components/style/properties/longhands/box.mako.rs1
-rw-r--r--components/style/values/animated/mod.rs4
-rw-r--r--components/style/values/specified/basic_shape.rs14
-rw-r--r--components/style/values/specified/svg_path.rs7
-rw-r--r--components/style_traits/arc_slice.rs2
-rw-r--r--components/style_traits/owned_slice.rs10
9 files changed, 33 insertions, 28 deletions
diff --git a/components/servo_arc/lib.rs b/components/servo_arc/lib.rs
index b7c179cd13f..f2f9fa00602 100644
--- a/components/servo_arc/lib.rs
+++ b/components/servo_arc/lib.rs
@@ -687,7 +687,10 @@ impl<H, T> Arc<HeaderSlice<H, [T]>> {
}
// We should have consumed the buffer exactly, maybe accounting
// for some padding from the alignment.
- debug_assert!((buffer.offset(size as isize) as usize - current as *mut u8 as usize) < align_of::<Self>());
+ debug_assert!(
+ (buffer.offset(size as isize) as usize - current as *mut u8 as usize) <
+ align_of::<Self>()
+ );
}
assert!(
items.next().is_none(),
@@ -792,7 +795,6 @@ pub struct ThinArc<H, T> {
phantom: PhantomData<(H, T)>,
}
-
impl<H: fmt::Debug, T: fmt::Debug> fmt::Debug for ThinArc<H, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Debug::fmt(self.deref(), f)
@@ -909,7 +911,10 @@ impl<H, T> Clone for ThinArc<H, T> {
impl<H, T> Drop for ThinArc<H, T> {
#[inline]
fn drop(&mut self) {
- let _ = Arc::from_thin(ThinArc { ptr: self.ptr, phantom: PhantomData, });
+ let _ = Arc::from_thin(ThinArc {
+ ptr: self.ptr,
+ phantom: PhantomData,
+ });
}
}
@@ -928,7 +933,9 @@ impl<H, T> Arc<HeaderSliceWithLength<H, [T]>> {
let thin_ptr = fat_ptr as *mut [usize] as *mut usize;
ThinArc {
ptr: unsafe {
- ptr::NonNull::new_unchecked(thin_ptr as *mut ArcInner<HeaderSliceWithLength<H, [T; 0]>>)
+ ptr::NonNull::new_unchecked(
+ thin_ptr as *mut ArcInner<HeaderSliceWithLength<H, [T; 0]>>,
+ )
},
phantom: PhantomData,
}
diff --git a/components/style/gecko/conversions.rs b/components/style/gecko/conversions.rs
index 607c7388c3d..43082a7c04a 100644
--- a/components/style/gecko/conversions.rs
+++ b/components/style/gecko/conversions.rs
@@ -536,12 +536,10 @@ pub mod basic_shape {
StyleGeometryBox, StyleShapeSource, StyleShapeSourceType,
};
use crate::gecko_bindings::sugar::refptr::RefPtr;
- use crate::values::computed::basic_shape::{
- BasicShape, ClippingShape, FloatAreaShape,
- };
+ use crate::values::computed::basic_shape::{BasicShape, ClippingShape, FloatAreaShape};
use crate::values::computed::motion::OffsetPath;
use crate::values::computed::url::ComputedUrl;
- use crate::values::generics::basic_shape::{Path, GeometryBox, ShapeBox, ShapeSource};
+ use crate::values::generics::basic_shape::{GeometryBox, Path, ShapeBox, ShapeSource};
use crate::values::specified::SVGPathData;
impl StyleShapeSource {
diff --git a/components/style/gecko/values.rs b/components/style/gecko/values.rs
index ba2074d8fdc..98fe90fe3d0 100644
--- a/components/style/gecko/values.rs
+++ b/components/style/gecko/values.rs
@@ -7,8 +7,8 @@
//! Different kind of helpers to interact with Gecko values.
use crate::counter_style::{Symbol, Symbols};
-use crate::gecko_bindings::structs::{nsStyleCoord, CounterStylePtr};
use crate::gecko_bindings::structs::StyleGridTrackBreadth;
+use crate::gecko_bindings::structs::{nsStyleCoord, CounterStylePtr};
use crate::gecko_bindings::sugar::ns_style_coord::{CoordData, CoordDataMut, CoordDataValue};
use crate::values::computed::{Angle, Length, LengthPercentage};
use crate::values::computed::{Number, NumberOrPercentage, Percentage};
diff --git a/components/style/properties/longhands/box.mako.rs b/components/style/properties/longhands/box.mako.rs
index 64239eeb83a..6d754964ecc 100644
--- a/components/style/properties/longhands/box.mako.rs
+++ b/components/style/properties/longhands/box.mako.rs
@@ -680,5 +680,6 @@ ${helpers.predefined_type(
"Either::Second(None_)",
gecko_pref="layout.css.webkit-line-clamp.enabled",
animation_value_type="Integer",
+ products="gecko",
spec="https://drafts.csswg.org/css-overflow-3/#line-clamp",
)}
diff --git a/components/style/values/animated/mod.rs b/components/style/values/animated/mod.rs
index 29e74859cd6..267ef0c8e6f 100644
--- a/components/style/values/animated/mod.rs
+++ b/components/style/values/animated/mod.rs
@@ -298,7 +298,6 @@ where
}
}
-
impl<T> ToAnimatedValue for Box<[T]>
where
T: ToAnimatedValue,
@@ -307,8 +306,7 @@ where
#[inline]
fn to_animated_value(self) -> Self::AnimatedValue {
- self
- .into_vec()
+ self.into_vec()
.into_iter()
.map(T::to_animated_value)
.collect::<Vec<_>>()
diff --git a/components/style/values/specified/basic_shape.rs b/components/style/values/specified/basic_shape.rs
index 70eab983510..4f627ceb07f 100644
--- a/components/style/values/specified/basic_shape.rs
+++ b/components/style/values/specified/basic_shape.rs
@@ -352,12 +352,14 @@ impl Polygon {
})
.unwrap_or_default();
- let coordinates = input.parse_comma_separated(|i| {
- Ok(PolygonCoord(
- LengthPercentage::parse(context, i)?,
- LengthPercentage::parse(context, i)?,
- ))
- })?.into();
+ let coordinates = input
+ .parse_comma_separated(|i| {
+ Ok(PolygonCoord(
+ LengthPercentage::parse(context, i)?,
+ LengthPercentage::parse(context, i)?,
+ ))
+ })?
+ .into();
Ok(Polygon { fill, coordinates })
}
diff --git a/components/style/values/specified/svg_path.rs b/components/style/values/specified/svg_path.rs
index e5276e5cce8..e5282e0a164 100644
--- a/components/style/values/specified/svg_path.rs
+++ b/components/style/values/specified/svg_path.rs
@@ -33,8 +33,7 @@ use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
pub struct SVGPathData(
// TODO(emilio): Should probably measure this somehow only from the
// specified values.
- #[ignore_malloc_size_of = "Arc"]
- pub crate::ArcSlice<PathCommand>
+ #[ignore_malloc_size_of = "Arc"] pub crate::ArcSlice<PathCommand>,
);
impl SVGPathData {
@@ -103,7 +102,9 @@ impl Parse for SVGPathData {
}
}
- Ok(SVGPathData(crate::ArcSlice::from_iter(path_parser.path.into_iter())))
+ Ok(SVGPathData(crate::ArcSlice::from_iter(
+ path_parser.path.into_iter(),
+ )))
}
}
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
}