cargo fix --edition

This commit is contained in:
Simon Sapin 2018-11-01 14:09:54 +01:00
parent e1fcffb336
commit a15d33a10e
197 changed files with 1414 additions and 1380 deletions

View file

@ -4,13 +4,13 @@
//! An invalidation processor for style changes due to document state changes.
use dom::TElement;
use element_state::DocumentState;
use invalidation::element::invalidator::{DescendantInvalidationLists, InvalidationVector};
use invalidation::element::invalidator::{Invalidation, InvalidationProcessor};
use invalidation::element::state_and_attributes;
use crate::dom::TElement;
use crate::element_state::DocumentState;
use crate::invalidation::element::invalidator::{DescendantInvalidationLists, InvalidationVector};
use crate::invalidation::element::invalidator::{Invalidation, InvalidationProcessor};
use crate::invalidation::element::state_and_attributes;
use crate::stylist::CascadeData;
use selectors::matching::{MatchingContext, MatchingMode, QuirksMode, VisitedHandlingMode};
use stylist::CascadeData;
/// A struct holding the members necessary to invalidate document state
/// selectors.

View file

@ -5,16 +5,16 @@
//! A wrapper over an element and a snapshot, that allows us to selector-match
//! against a past state of the element.
use dom::TElement;
use element_state::ElementState;
use selector_parser::{AttrValue, NonTSPseudoClass, PseudoElement, SelectorImpl};
use selector_parser::{Snapshot, SnapshotMap};
use crate::dom::TElement;
use crate::element_state::ElementState;
use crate::selector_parser::{AttrValue, NonTSPseudoClass, PseudoElement, SelectorImpl};
use crate::selector_parser::{Snapshot, SnapshotMap};
use crate::{Atom, CaseSensitivityExt, LocalName, Namespace, WeakAtom};
use selectors::attr::{AttrSelectorOperation, CaseSensitivity, NamespaceConstraint};
use selectors::matching::{ElementSelectorFlags, MatchingContext};
use selectors::{Element, OpaqueElement};
use std::cell::Cell;
use std::fmt;
use {Atom, CaseSensitivityExt, LocalName, Namespace, WeakAtom};
/// In order to compute restyle hints, we perform a selector match against a
/// list of partial selectors whose rightmost simple selector may be sensitive
@ -60,7 +60,7 @@ pub trait ElementSnapshot: Sized {
/// A callback that should be called for each class of the snapshot. Should
/// only be called if `has_attrs()` returns true.
fn each_class<F>(&self, F)
fn each_class<F>(&self, _: F)
where
F: FnMut(&Atom);

View file

@ -4,18 +4,18 @@
//! Code for invalidations due to state or attribute changes.
use context::QuirksMode;
use element_state::{DocumentState, ElementState};
use crate::context::QuirksMode;
use crate::element_state::{DocumentState, ElementState};
use crate::selector_map::{MaybeCaseInsensitiveHashMap, SelectorMap, SelectorMapEntry};
use crate::selector_parser::SelectorImpl;
use crate::{Atom, LocalName, Namespace};
use fallible::FallibleVec;
use hashglobe::FailedAllocationError;
use selector_map::{MaybeCaseInsensitiveHashMap, SelectorMap, SelectorMapEntry};
use selector_parser::SelectorImpl;
use selectors::attr::NamespaceConstraint;
use selectors::parser::{Combinator, Component};
use selectors::parser::{Selector, SelectorIter, Visit};
use selectors::visitor::SelectorVisitor;
use smallvec::SmallVec;
use {Atom, LocalName, Namespace};
/// Mapping between (partial) CompoundSelectors (and the combinator to their
/// right) and the states and attributes they depend on.

View file

@ -5,9 +5,9 @@
//! The struct that takes care of encapsulating all the logic on where and how
//! element styles need to be invalidated.
use context::StackLimitChecker;
use dom::{TElement, TNode, TShadowRoot};
use selector_parser::SelectorImpl;
use crate::context::StackLimitChecker;
use crate::dom::{TElement, TNode, TShadowRoot};
use crate::selector_parser::SelectorImpl;
use selectors::matching::matches_compound_selector_from;
use selectors::matching::{CompoundSelectorMatchingResult, MatchingContext};
use selectors::parser::{Combinator, Component, Selector};

View file

@ -4,9 +4,9 @@
//! Restyle hints: an optimization to avoid unnecessarily matching selectors.
use crate::traversal_flags::TraversalFlags;
#[cfg(feature = "gecko")]
use gecko_bindings::structs::nsRestyleHint;
use traversal_flags::TraversalFlags;
bitflags! {
/// The kind of restyle we need to do for a given element.

View file

@ -5,24 +5,24 @@
//! An invalidation processor for style changes due to state and attribute
//! changes.
use context::SharedStyleContext;
use data::ElementData;
use dom::TElement;
use element_state::ElementState;
use invalidation::element::element_wrapper::{ElementSnapshot, ElementWrapper};
use invalidation::element::invalidation_map::*;
use invalidation::element::invalidator::{DescendantInvalidationLists, InvalidationVector};
use invalidation::element::invalidator::{Invalidation, InvalidationProcessor};
use invalidation::element::restyle_hints::RestyleHint;
use selector_map::SelectorMap;
use selector_parser::Snapshot;
use crate::context::SharedStyleContext;
use crate::data::ElementData;
use crate::dom::TElement;
use crate::element_state::ElementState;
use crate::invalidation::element::element_wrapper::{ElementSnapshot, ElementWrapper};
use crate::invalidation::element::invalidation_map::*;
use crate::invalidation::element::invalidator::{DescendantInvalidationLists, InvalidationVector};
use crate::invalidation::element::invalidator::{Invalidation, InvalidationProcessor};
use crate::invalidation::element::restyle_hints::RestyleHint;
use crate::selector_map::SelectorMap;
use crate::selector_parser::Snapshot;
use crate::stylesheets::origin::{Origin, OriginSet};
use crate::{Atom, WeakAtom};
use selectors::attr::CaseSensitivity;
use selectors::matching::matches_selector;
use selectors::matching::{MatchingContext, MatchingMode, VisitedHandlingMode};
use selectors::NthIndexCache;
use smallvec::SmallVec;
use stylesheets::origin::{Origin, OriginSet};
use {Atom, WeakAtom};
/// The collector implementation.
struct Collector<'a, 'b: 'a, 'selectors: 'a, E>

View file

@ -4,12 +4,12 @@
//! Code related to the invalidation of media-query-affected rules.
use context::QuirksMode;
use crate::context::QuirksMode;
use crate::media_queries::Device;
use crate::shared_lock::SharedRwLockReadGuard;
use crate::stylesheets::{DocumentRule, ImportRule, MediaRule};
use crate::stylesheets::{NestedRuleIterationCondition, Stylesheet, SupportsRule};
use fxhash::FxHashSet;
use media_queries::Device;
use shared_lock::SharedRwLockReadGuard;
use stylesheets::{DocumentRule, ImportRule, MediaRule};
use stylesheets::{NestedRuleIterationCondition, Stylesheet, SupportsRule};
/// A key for a given media query result.
///
@ -115,7 +115,7 @@ impl NestedRuleIterationCondition for PotentiallyEffectiveMediaRules {
quirks_mode: QuirksMode,
rule: &DocumentRule,
) -> bool {
use stylesheets::EffectiveRules;
use crate::stylesheets::EffectiveRules;
EffectiveRules::process_document(guard, device, quirks_mode, rule)
}
@ -126,7 +126,7 @@ impl NestedRuleIterationCondition for PotentiallyEffectiveMediaRules {
quirks_mode: QuirksMode,
rule: &SupportsRule,
) -> bool {
use stylesheets::EffectiveRules;
use crate::stylesheets::EffectiveRules;
EffectiveRules::process_supports(guard, device, quirks_mode, rule)
}
}

View file

@ -7,19 +7,19 @@
#![deny(unsafe_code)]
use dom::{TDocument, TElement, TNode};
use crate::dom::{TDocument, TElement, TNode};
use crate::invalidation::element::element_wrapper::{ElementSnapshot, ElementWrapper};
use crate::invalidation::element::restyle_hints::RestyleHint;
use crate::media_queries::Device;
use crate::selector_parser::{SelectorImpl, Snapshot, SnapshotMap};
use crate::shared_lock::SharedRwLockReadGuard;
use crate::stylesheets::{CssRule, StylesheetInDocument};
use crate::Atom;
use crate::CaseSensitivityExt;
use crate::LocalName as SelectorLocalName;
use fxhash::FxHashSet;
use invalidation::element::element_wrapper::{ElementSnapshot, ElementWrapper};
use invalidation::element::restyle_hints::RestyleHint;
use media_queries::Device;
use selector_parser::{SelectorImpl, Snapshot, SnapshotMap};
use selectors::attr::CaseSensitivity;
use selectors::parser::{Component, LocalName, Selector};
use shared_lock::SharedRwLockReadGuard;
use stylesheets::{CssRule, StylesheetInDocument};
use Atom;
use CaseSensitivityExt;
use LocalName as SelectorLocalName;
/// A style sheet invalidation represents a kind of element or subtree that may
/// need to be restyled. Whether it represents a whole subtree or just a single
@ -419,7 +419,7 @@ impl StylesheetInvalidationSet {
guard: &SharedRwLockReadGuard,
device: &Device,
) {
use stylesheets::CssRule::*;
use crate::stylesheets::CssRule::*;
debug!("StylesheetInvalidationSet::collect_invalidations_for_rule");
debug_assert!(!self.fully_invalid, "Not worth to be here!");