diff --git a/components/selectors/tree.rs b/components/selectors/tree.rs index bfa59898b50..9db190c8109 100644 --- a/components/selectors/tree.rs +++ b/components/selectors/tree.rs @@ -22,7 +22,7 @@ impl OpaqueElement { /// Creates a new OpaqueElement from an arbitrarily-typed pointer. pub fn new(ptr: &T) -> Self { unsafe { - OpaqueElement(NonNull::new_unchecked(ptr as *const T as *const () as *mut ())) + OpaqueElement(NonNull::new_unchecked(ptr as *const T as *const () as *mut ())) } } } diff --git a/components/servo_arc/lib.rs b/components/servo_arc/lib.rs index 99e9f67f0d0..05296165acc 100644 --- a/components/servo_arc/lib.rs +++ b/components/servo_arc/lib.rs @@ -169,7 +169,7 @@ impl Arc { /// Convert the Arc to a raw pointer, suitable for use across FFI /// /// Note: This returns a pointer to the data T, which is offset in the allocation. - /// + /// /// It is recommended to use RawOffsetArc for this. #[inline] fn into_raw(this: Self) -> *const T { @@ -312,7 +312,7 @@ impl Arc { /// /// If this `Arc` is uniquely owned, `make_mut()` will provide a mutable /// reference to the contents. If not, `make_mut()` will create a _new_ `Arc` - /// with a copy of the contents, update `this` to point to it, and provide + /// with a copy of the contents, update `this` to point to it, and provide /// a mutable reference to its contents. /// /// This is useful for implementing copy-on-write schemes where you wish to @@ -702,9 +702,11 @@ impl ThinArc { F: FnOnce(&Arc>) -> U, { // Synthesize transient Arc, which never touches the refcount of the ArcInner. - let transient = unsafe { NoDrop::new(Arc { - p: ptr::NonNull::new_unchecked(thin_to_thick(self.ptr)), - })}; + let transient = unsafe { + NoDrop::new(Arc { + p: ptr::NonNull::new_unchecked(thin_to_thick(self.ptr)), + }) + }; // Expose the transient Arc to the callback, which may clone it if it wants. let result = f(&transient); @@ -722,7 +724,7 @@ impl ThinArc { /// iterator to generate the slice. pub fn from_header_and_iter(header: H, items: I) -> Self where - I: Iterator + ExactSizeIterator + I: Iterator + ExactSizeIterator, { let header = HeaderWithLength::new(header, items.len()); Arc::into_thin(Arc::from_header_and_iter(header, items)) @@ -1056,7 +1058,6 @@ pub struct ArcUnion { unsafe impl Send for ArcUnion {} unsafe impl Sync for ArcUnion {} - impl PartialEq for ArcUnion { fn eq(&self, other: &Self) -> bool { use ArcUnionBorrow::*; @@ -1104,16 +1105,12 @@ impl ArcUnion { /// Creates an `ArcUnion` from an instance of the first type. pub fn from_first(other: Arc) -> Self { - unsafe { - Self::new(Arc::into_raw(other) as *mut _) - } + unsafe { Self::new(Arc::into_raw(other) as *mut _) } } /// Creates an `ArcUnion` from an instance of the second type. pub fn from_second(other: Arc) -> Self { - unsafe { - Self::new(((Arc::into_raw(other) as usize) | 0x1) as *mut _) - } + unsafe { Self::new(((Arc::into_raw(other) as usize) | 0x1) as *mut _) } } /// Returns true if this `ArcUnion` contains the first type. diff --git a/components/style/properties/cascade.rs b/components/style/properties/cascade.rs index cb8a4ae7c39..af5273e0a73 100644 --- a/components/style/properties/cascade.rs +++ b/components/style/properties/cascade.rs @@ -13,7 +13,6 @@ use media_queries::Device; use properties::{ComputedValues, StyleBuilder}; use properties::{LonghandId, LonghandIdSet}; use properties::{PropertyDeclaration, PropertyDeclarationId, DeclarationImportanceIterator}; -use properties::{CSSWideKeyword, WideKeywordDeclaration}; use properties::CASCADE_PROPERTY; use rule_cache::{RuleCache, RuleCacheConditions}; use rule_tree::{CascadeLevel, StrongRuleNode}; @@ -790,6 +789,8 @@ impl<'a, 'b: 'a> Cascade<'a, 'b> { self.seen.contains(LonghandId::MozMinFontSizeRatio) || self.seen.contains(LonghandId::FontFamily) { + use properties::{CSSWideKeyword, WideKeywordDeclaration}; + // font-size must be explicitly inherited to handle lang // changes and scriptlevel changes. //