style: Remove some redundant use statements.

This commit is contained in:
Emilio Cobos Álvarez 2019-04-03 12:00:44 +02:00
parent c106fb1231
commit b268ef6aed
7 changed files with 4 additions and 20 deletions

View file

@ -418,10 +418,8 @@ impl nsStyleImage {
use self::structs::NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE as CLOSEST_SIDE; use self::structs::NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE as CLOSEST_SIDE;
use self::structs::NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER as FARTHEST_CORNER; use self::structs::NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER as FARTHEST_CORNER;
use self::structs::NS_STYLE_GRADIENT_SIZE_FARTHEST_SIDE as FARTHEST_SIDE; use self::structs::NS_STYLE_GRADIENT_SIZE_FARTHEST_SIDE as FARTHEST_SIDE;
use crate::values::computed::image::LineDirection;
use crate::values::computed::position::Position; use crate::values::computed::position::Position;
use crate::values::computed::Length; use crate::values::generics::image::{Circle, ColorStop, Ellipse};
use crate::values::generics::image::{Circle, ColorStop, CompatMode, Ellipse};
use crate::values::generics::image::{EndingShape, GradientKind, ShapeExtent}; use crate::values::generics::image::{EndingShape, GradientKind, ShapeExtent};
let gecko_gradient = bindings::Gecko_GetGradientImageValue(self) let gecko_gradient = bindings::Gecko_GetGradientImageValue(self)
@ -834,8 +832,7 @@ impl TrackSize<LengthPercentage> {
/// Return TrackSize from given two nsStyleCoord /// Return TrackSize from given two nsStyleCoord
pub fn from_gecko_style_coords<T: CoordData>(gecko_min: &T, gecko_max: &T) -> Self { pub fn from_gecko_style_coords<T: CoordData>(gecko_min: &T, gecko_max: &T) -> Self {
use crate::gecko_bindings::structs::root::nsStyleUnit; use crate::gecko_bindings::structs::root::nsStyleUnit;
use crate::values::computed::length::LengthPercentage; use crate::values::generics::grid::TrackBreadth;
use crate::values::generics::grid::{TrackBreadth, TrackSize};
if gecko_min.unit() == nsStyleUnit::eStyleUnit_None { if gecko_min.unit() == nsStyleUnit::eStyleUnit_None {
debug_assert!( debug_assert!(
@ -862,8 +859,6 @@ impl TrackSize<LengthPercentage> {
/// Save TrackSize to given gecko fields. /// Save TrackSize to given gecko fields.
pub fn to_gecko_style_coords<T: CoordDataMut>(&self, gecko_min: &mut T, gecko_max: &mut T) { pub fn to_gecko_style_coords<T: CoordDataMut>(&self, gecko_min: &mut T, gecko_max: &mut T) {
use crate::values::generics::grid::TrackSize;
match *self { match *self {
TrackSize::FitContent(ref lop) => { TrackSize::FitContent(ref lop) => {
// Gecko sets min value to None and max value to the actual value in fit-content // Gecko sets min value to None and max value to the actual value in fit-content
@ -893,8 +888,6 @@ impl TrackListValue<LengthPercentage, Integer> {
/// Save TrackSize to given gecko fields. /// Save TrackSize to given gecko fields.
pub fn to_gecko_style_coords<T: CoordDataMut>(&self, gecko_min: &mut T, gecko_max: &mut T) { pub fn to_gecko_style_coords<T: CoordDataMut>(&self, gecko_min: &mut T, gecko_max: &mut T) {
use crate::values::generics::grid::TrackListValue;
match *self { match *self {
TrackListValue::TrackSize(ref size) => size.to_gecko_style_coords(gecko_min, gecko_max), TrackListValue::TrackSize(ref size) => size.to_gecko_style_coords(gecko_min, gecko_max),
_ => unreachable!("Should only transform from track-size computed values"), _ => unreachable!("Should only transform from track-size computed values"),
@ -918,8 +911,6 @@ where
pub fn from_gecko_rect( pub fn from_gecko_rect(
sides: &crate::gecko_bindings::structs::nsStyleSides, sides: &crate::gecko_bindings::structs::nsStyleSides,
) -> Option<crate::values::generics::rect::Rect<T>> { ) -> Option<crate::values::generics::rect::Rect<T>> {
use crate::values::generics::rect::Rect;
Some(Rect::new( Some(Rect::new(
T::from_gecko_style_coord(&sides.data_at(0)).expect("coord[0] cound not convert"), T::from_gecko_style_coord(&sides.data_at(0)).expect("coord[0] cound not convert"),
T::from_gecko_style_coord(&sides.data_at(1)).expect("coord[1] cound not convert"), T::from_gecko_style_coord(&sides.data_at(1)).expect("coord[1] cound not convert"),

View file

@ -317,7 +317,6 @@ impl GeckoStyleCoordConvertible for ScrollSnapPoint<LengthPercentage> {
fn from_gecko_style_coord<T: CoordData>(coord: &T) -> Option<Self> { fn from_gecko_style_coord<T: CoordData>(coord: &T) -> Option<Self> {
use crate::gecko_bindings::structs::root::nsStyleUnit; use crate::gecko_bindings::structs::root::nsStyleUnit;
use crate::values::generics::gecko::ScrollSnapPoint;
Some(match coord.unit() { Some(match coord.unit() {
nsStyleUnit::eStyleUnit_None => ScrollSnapPoint::None, nsStyleUnit::eStyleUnit_None => ScrollSnapPoint::None,

View file

@ -986,7 +986,6 @@ fn get_animation_rule(
element: &GeckoElement, element: &GeckoElement,
cascade_level: CascadeLevel, cascade_level: CascadeLevel,
) -> Option<Arc<Locked<PropertyDeclarationBlock>>> { ) -> Option<Arc<Locked<PropertyDeclarationBlock>>> {
use crate::gecko_bindings::sugar::ownership::HasSimpleFFI;
use crate::properties::longhands::ANIMATABLE_PROPERTY_COUNT; use crate::properties::longhands::ANIMATABLE_PROPERTY_COUNT;
// There's a very rough correlation between the number of effects // There's a very rough correlation between the number of effects

View file

@ -1239,7 +1239,7 @@ impl StrongRuleNode {
use crate::gecko_bindings::structs::NS_AUTHOR_SPECIFIED_BACKGROUND; use crate::gecko_bindings::structs::NS_AUTHOR_SPECIFIED_BACKGROUND;
use crate::gecko_bindings::structs::NS_AUTHOR_SPECIFIED_BORDER; use crate::gecko_bindings::structs::NS_AUTHOR_SPECIFIED_BORDER;
use crate::gecko_bindings::structs::NS_AUTHOR_SPECIFIED_PADDING; use crate::gecko_bindings::structs::NS_AUTHOR_SPECIFIED_PADDING;
use crate::properties::{CSSWideKeyword, LonghandId, LonghandIdSet}; use crate::properties::{CSSWideKeyword, LonghandId};
use crate::properties::{PropertyDeclaration, PropertyDeclarationId}; use crate::properties::{PropertyDeclaration, PropertyDeclarationId};
use crate::values::specified::Color; use crate::values::specified::Color;
use std::borrow::Cow; use std::borrow::Cow;

View file

@ -211,8 +211,6 @@ where
type Item = (&'a S, SheetRebuildKind); type Item = (&'a S, SheetRebuildKind);
fn next(&mut self) -> Option<Self::Item> { fn next(&mut self) -> Option<Self::Item> {
use std::mem;
loop { loop {
let potential_sheet = self.iter.next()?; let potential_sheet = self.iter.next()?;

View file

@ -307,8 +307,6 @@ pub fn resolve_style<E>(
where where
E: TElement, E: TElement,
{ {
use crate::style_resolver::StyleResolverForElement;
debug_assert!( debug_assert!(
rule_inclusion == RuleInclusion::DefaultOnly || rule_inclusion == RuleInclusion::DefaultOnly ||
pseudo.map_or(false, |p| p.is_before_or_after()) || pseudo.map_or(false, |p| p.is_before_or_after()) ||
@ -406,7 +404,6 @@ pub fn recalc_style_at<E, D, F>(
D: DomTraversal<E>, D: DomTraversal<E>,
F: FnMut(E::ConcreteNode), F: FnMut(E::ConcreteNode),
{ {
use crate::traversal_flags::TraversalFlags;
use std::cmp; use std::cmp;
let flags = context.shared.traversal_flags; let flags = context.shared.traversal_flags;

View file

@ -118,7 +118,7 @@ impl ToCss for FontTag {
where where
W: Write, W: Write,
{ {
use byteorder::{BigEndian, ByteOrder}; use byteorder::ByteOrder;
use std::str; use std::str;
let mut raw = [0u8; 4]; let mut raw = [0u8; 4];