Skip to content

Commit

Permalink
cargo fix --edition
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Nov 10, 2018
1 parent e1fcffb commit a15d33a
Show file tree
Hide file tree
Showing 197 changed files with 1,413 additions and 1,379 deletions.
2 changes: 1 addition & 1 deletion components/hashglobe/src/fake.rs
Expand Up @@ -26,7 +26,7 @@ pub use std::collections::hash_set::{IntoIter as SetIntoIter, Iter as SetIter};
#[derive(Clone)]
pub struct HashMap<K, V, S = RandomState>(StdMap<K, V, S>);

use FailedAllocationError;
use crate::FailedAllocationError;

impl<K, V, S> Deref for HashMap<K, V, S> {
type Target = StdMap<K, V, S>;
Expand Down
2 changes: 1 addition & 1 deletion components/hashglobe/src/hash_map.rs
Expand Up @@ -23,7 +23,7 @@ use std::ops::{Deref, Index};
use super::table::BucketState::{Empty, Full};
use super::table::{self, Bucket, EmptyBucket, FullBucket, FullBucketMut, RawTable, SafeHash};

use FailedAllocationError;
use crate::FailedAllocationError;

const MIN_NONZERO_RAW_CAPACITY: usize = 32; // must be a power of two

Expand Down
8 changes: 4 additions & 4 deletions components/hashglobe/src/table.rs
Expand Up @@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use alloc::{alloc, dealloc};
use shim::{Shared, Unique};
use crate::alloc::{alloc, dealloc};
use crate::shim::{Shared, Unique};
use std::cmp;
use std::hash::{BuildHasher, Hash, Hasher};
use std::marker;
Expand All @@ -18,7 +18,7 @@ use std::ops::{Deref, DerefMut};
use std::ptr;

use self::BucketState::*;
use FailedAllocationError;
use crate::FailedAllocationError;

/// Integer type used for stored hash values.
///
Expand Down Expand Up @@ -795,7 +795,7 @@ impl<K, V> RawTable<K, V> {
let buffer = alloc(size, alignment);

if buffer.is_null() {
use AllocationInfo;
use crate::AllocationInfo;
return Err(FailedAllocationError {
reason: "out of memory when allocating RawTable",
allocation_info: Some(AllocationInfo { size, alignment }),
Expand Down
2 changes: 1 addition & 1 deletion components/selectors/attr.rs
Expand Up @@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use crate::parser::SelectorImpl;
use cssparser::ToCss;
use parser::SelectorImpl;
use std::fmt;

#[derive(Clone, Eq, PartialEq)]
Expand Down
4 changes: 2 additions & 2 deletions components/selectors/builder.rs
Expand Up @@ -17,9 +17,9 @@
//! is non-trivial. This module encapsulates those details and presents an
//! easy-to-use API for the parser.

use parser::{Combinator, Component, SelectorImpl};
use crate::parser::{Combinator, Component, SelectorImpl};
use crate::sink::Push;
use servo_arc::{Arc, HeaderWithLength, ThinArc};
use sink::Push;
use smallvec::{self, SmallVec};
use std::cmp;
use std::iter;
Expand Down
10 changes: 5 additions & 5 deletions components/selectors/context.rs
Expand Up @@ -2,11 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use attr::CaseSensitivity;
use bloom::BloomFilter;
use nth_index_cache::NthIndexCache;
use parser::SelectorImpl;
use tree::{Element, OpaqueElement};
use crate::attr::CaseSensitivity;
use crate::bloom::BloomFilter;
use crate::nth_index_cache::NthIndexCache;
use crate::parser::SelectorImpl;
use crate::tree::{Element, OpaqueElement};

/// What kind of selector matching mode we should use.
///
Expand Down
6 changes: 3 additions & 3 deletions components/selectors/lib.rs
Expand Up @@ -31,6 +31,6 @@ pub mod sink;
mod tree;
pub mod visitor;

pub use nth_index_cache::NthIndexCache;
pub use parser::{Parser, SelectorImpl, SelectorList};
pub use tree::{Element, OpaqueElement};
pub use crate::nth_index_cache::NthIndexCache;
pub use crate::parser::{Parser, SelectorImpl, SelectorList};
pub use crate::tree::{Element, OpaqueElement};
22 changes: 11 additions & 11 deletions components/selectors/matching.rs
Expand Up @@ -2,16 +2,16 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use attr::{AttrSelectorOperation, NamespaceConstraint, ParsedAttrSelectorOperation};
use bloom::{BloomFilter, BLOOM_HASH_MASK};
use nth_index_cache::NthIndexCacheInner;
use parser::{AncestorHashes, Combinator, Component, LocalName};
use parser::{NonTSPseudoClass, Selector, SelectorImpl, SelectorIter, SelectorList};
use crate::attr::{AttrSelectorOperation, NamespaceConstraint, ParsedAttrSelectorOperation};
use crate::bloom::{BloomFilter, BLOOM_HASH_MASK};
use crate::nth_index_cache::NthIndexCacheInner;
use crate::parser::{AncestorHashes, Combinator, Component, LocalName};
use crate::parser::{NonTSPseudoClass, Selector, SelectorImpl, SelectorIter, SelectorList};
use crate::tree::Element;
use std::borrow::Borrow;
use std::iter;
use tree::Element;

pub use context::*;
pub use crate::context::*;

// The bloom filter for descendant CSS selectors will have a <1% false
// positive rate until it has this many selectors in it, then it will
Expand Down Expand Up @@ -678,7 +678,7 @@ where
element.namespace() == url.borrow()
},
Component::ExplicitNoNamespace => {
let ns = ::parser::namespace_empty_string::<E::Impl>();
let ns = crate::parser::namespace_empty_string::<E::Impl>();
element.namespace() == ns.borrow()
},
Component::ID(ref id) => {
Expand All @@ -693,7 +693,7 @@ where
} => {
let is_html = element.is_html_element_in_html_document();
element.attr_matches(
&NamespaceConstraint::Specific(&::parser::namespace_empty_string::<E::Impl>()),
&NamespaceConstraint::Specific(&crate::parser::namespace_empty_string::<E::Impl>()),
select_name(is_html, local_name, local_name_lower),
&AttrSelectorOperation::Exists,
)
Expand All @@ -710,7 +710,7 @@ where
}
let is_html = element.is_html_element_in_html_document();
element.attr_matches(
&NamespaceConstraint::Specific(&::parser::namespace_empty_string::<E::Impl>()),
&NamespaceConstraint::Specific(&crate::parser::namespace_empty_string::<E::Impl>()),
local_name,
&AttrSelectorOperation::WithValue {
operator: operator,
Expand All @@ -728,7 +728,7 @@ where
let namespace = match attr_sel.namespace() {
Some(ns) => ns,
None => {
empty_string = ::parser::namespace_empty_string::<E::Impl>();
empty_string = crate::parser::namespace_empty_string::<E::Impl>();
NamespaceConstraint::Specific(&empty_string)
},
};
Expand Down
2 changes: 1 addition & 1 deletion components/selectors/nth_index_cache.rs
Expand Up @@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use crate::tree::OpaqueElement;
use fxhash::FxHashMap;
use tree::OpaqueElement;

/// A cache to speed up matching of nth-index-like selectors.
///
Expand Down
22 changes: 11 additions & 11 deletions components/selectors/parser.rs
Expand Up @@ -2,26 +2,26 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use attr::{AttrSelectorOperator, AttrSelectorWithOptionalNamespace};
use attr::{NamespaceConstraint, ParsedAttrSelectorOperation};
use attr::{ParsedCaseSensitivity, SELECTOR_WHITESPACE};
use bloom::BLOOM_HASH_MASK;
use builder::{SelectorBuilder, SpecificityAndFlags};
use context::QuirksMode;
use crate::attr::{AttrSelectorOperator, AttrSelectorWithOptionalNamespace};
use crate::attr::{NamespaceConstraint, ParsedAttrSelectorOperation};
use crate::attr::{ParsedCaseSensitivity, SELECTOR_WHITESPACE};
use crate::bloom::BLOOM_HASH_MASK;
use crate::builder::{SelectorBuilder, SpecificityAndFlags};
use crate::context::QuirksMode;
use crate::sink::Push;
pub use crate::visitor::{SelectorVisitor, Visit};
use cssparser::{parse_nth, serialize_identifier};
use cssparser::{BasicParseError, BasicParseErrorKind, ParseError, ParseErrorKind};
use cssparser::{CowRcStr, Delimiter, SourceLocation};
use cssparser::{CssStringWriter, Parser as CssParser, ToCss, Token};
use precomputed_hash::PrecomputedHash;
use servo_arc::ThinArc;
use sink::Push;
use smallvec::SmallVec;
use std::borrow::{Borrow, Cow};
use std::fmt::{self, Debug, Display, Write};
use std::iter::Rev;
use std::slice;
use thin_slice::ThinBoxedSlice;
pub use visitor::{SelectorVisitor, Visit};

/// A trait that represents a pseudo-element.
pub trait PseudoElement: Sized + ToCss {
Expand Down Expand Up @@ -465,7 +465,7 @@ where
let namespace = match attr_selector.namespace() {
Some(ns) => ns,
None => {
empty_string = ::parser::namespace_empty_string::<Impl>();
empty_string = crate::parser::namespace_empty_string::<Impl>();
NamespaceConstraint::Specific(&empty_string)
},
};
Expand Down Expand Up @@ -2147,9 +2147,9 @@ where
#[cfg(test)]
pub mod tests {
use super::*;
use builder::HAS_PSEUDO_BIT;
use crate::builder::HAS_PSEUDO_BIT;
use crate::parser;
use cssparser::{serialize_identifier, Parser as CssParser, ParserInput, ToCss};
use parser;
use std::collections::HashMap;
use std::fmt;

Expand Down
6 changes: 3 additions & 3 deletions components/selectors/tree.rs
Expand Up @@ -5,9 +5,9 @@
//! Traits that nodes must implement. Breaks the otherwise-cyclic dependency
//! between layout and style.

use attr::{AttrSelectorOperation, CaseSensitivity, NamespaceConstraint};
use matching::{ElementSelectorFlags, MatchingContext};
use parser::SelectorImpl;
use crate::attr::{AttrSelectorOperation, CaseSensitivity, NamespaceConstraint};
use crate::matching::{ElementSelectorFlags, MatchingContext};
use crate::parser::SelectorImpl;
use std::fmt::Debug;
use std::ptr::NonNull;

Expand Down
4 changes: 2 additions & 2 deletions components/selectors/visitor.rs
Expand Up @@ -6,8 +6,8 @@

#![deny(missing_docs)]

use attr::NamespaceConstraint;
use parser::{Combinator, Component, SelectorImpl};
use crate::attr::NamespaceConstraint;
use crate::parser::{Combinator, Component, SelectorImpl};

/// A trait to visit selector properties.
///
Expand Down
2 changes: 1 addition & 1 deletion components/servo_arc/lib.rs
Expand Up @@ -1060,7 +1060,7 @@ unsafe impl<A: Sync + Send, B: Send + Sync> Sync for ArcUnion<A, B> {}

impl<A: PartialEq, B: PartialEq> PartialEq for ArcUnion<A, B> {
fn eq(&self, other: &Self) -> bool {
use ArcUnionBorrow::*;
use crate::ArcUnionBorrow::*;
match (self.borrow(), other.borrow()) {
(First(x), First(y)) => x == y,
(Second(x), Second(y)) => x == y,
Expand Down
34 changes: 17 additions & 17 deletions components/style/animation.rs
Expand Up @@ -8,29 +8,29 @@
// compile it out so that people remember it exists, thus the cfg'd Sender
// import.

use bezier::Bezier;
use context::SharedStyleContext;
use dom::{OpaqueNode, TElement};
use font_metrics::FontMetricsProvider;
use properties::animated_properties::AnimatedProperty;
use properties::longhands::animation_direction::computed_value::single_value::T as AnimationDirection;
use properties::longhands::animation_play_state::computed_value::single_value::T as AnimationPlayState;
use properties::{self, CascadeMode, ComputedValues, LonghandId};
use rule_tree::CascadeLevel;
use crate::bezier::Bezier;
use crate::context::SharedStyleContext;
use crate::dom::{OpaqueNode, TElement};
use crate::font_metrics::FontMetricsProvider;
use crate::properties::animated_properties::AnimatedProperty;
use crate::properties::longhands::animation_direction::computed_value::single_value::T as AnimationDirection;
use crate::properties::longhands::animation_play_state::computed_value::single_value::T as AnimationPlayState;
use crate::properties::{self, CascadeMode, ComputedValues, LonghandId};
use crate::rule_tree::CascadeLevel;
use crate::stylesheets::keyframes_rule::{KeyframesAnimation, KeyframesStep, KeyframesStepValue};
use crate::timer::Timer;
use crate::values::computed::box_::TransitionProperty;
use crate::values::computed::Time;
use crate::values::computed::TimingFunction;
use crate::values::generics::box_::AnimationIterationCount;
use crate::values::generics::easing::{StepPosition, TimingFunction as GenericTimingFunction};
use crate::Atom;
use servo_arc::Arc;
#[cfg(feature = "servo")]
use servo_channel::Sender;
use std::fmt;
#[cfg(feature = "gecko")]
use std::sync::mpsc::Sender;
use stylesheets::keyframes_rule::{KeyframesAnimation, KeyframesStep, KeyframesStepValue};
use timer::Timer;
use values::computed::box_::TransitionProperty;
use values::computed::Time;
use values::computed::TimingFunction;
use values::generics::box_::AnimationIterationCount;
use values::generics::easing::{StepPosition, TimingFunction as GenericTimingFunction};
use Atom;

/// This structure represents a keyframes animation current iteration state.
///
Expand Down
6 changes: 3 additions & 3 deletions components/style/applicable_declarations.rs
Expand Up @@ -4,10 +4,10 @@

//! Applicable declarations management.

use properties::PropertyDeclarationBlock;
use rule_tree::{CascadeLevel, ShadowCascadeOrder, StyleSource};
use crate::properties::PropertyDeclarationBlock;
use crate::rule_tree::{CascadeLevel, ShadowCascadeOrder, StyleSource};
use crate::shared_lock::Locked;
use servo_arc::Arc;
use shared_lock::Locked;
use smallvec::SmallVec;
use std::fmt::{self, Debug};

Expand Down
14 changes: 7 additions & 7 deletions components/style/attr.rs
Expand Up @@ -7,20 +7,20 @@
//! [attr]: https://dom.spec.whatwg.org/#interface-attr

use app_units::Au;
use crate::properties::PropertyDeclarationBlock;
use crate::shared_lock::Locked;
use crate::str::str_join;
use crate::str::{read_exponent, read_fraction, HTML_SPACE_CHARACTERS};
use crate::str::{read_numbers, split_commas, split_html_space_chars};
use crate::values::specified::Length;
use crate::{Atom, LocalName, Namespace, Prefix};
use cssparser::{self, Color, RGBA};
use euclid::num::Zero;
use num_traits::ToPrimitive;
use properties::PropertyDeclarationBlock;
use selectors::attr::AttrSelectorOperation;
use servo_arc::Arc;
use servo_url::ServoUrl;
use shared_lock::Locked;
use std::str::FromStr;
use str::str_join;
use str::{read_exponent, read_fraction, HTML_SPACE_CHARACTERS};
use str::{read_numbers, split_commas, split_html_space_chars};
use values::specified::Length;
use {Atom, LocalName, Namespace, Prefix};

// Duplicated from script::dom::values.
const UNSIGNED_LONG_MAX: u32 = 2147483647;
Expand Down
16 changes: 8 additions & 8 deletions components/style/author_styles.rs
Expand Up @@ -5,16 +5,16 @@
//! A set of author stylesheets and their computed representation, such as the
//! ones used for ShadowRoot and XBL.

use context::QuirksMode;
use dom::TElement;
use crate::context::QuirksMode;
use crate::dom::TElement;
use crate::invalidation::media_queries::ToMediaListKey;
use crate::media_queries::Device;
use crate::shared_lock::SharedRwLockReadGuard;
use crate::stylesheet_set::AuthorStylesheetSet;
use crate::stylesheets::StylesheetInDocument;
use crate::stylist::CascadeData;
#[cfg(feature = "gecko")]
use gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI};
use invalidation::media_queries::ToMediaListKey;
use media_queries::Device;
use shared_lock::SharedRwLockReadGuard;
use stylesheet_set::AuthorStylesheetSet;
use stylesheets::StylesheetInDocument;
use stylist::CascadeData;

/// A set of author stylesheets and their computed representation, such as the
/// ones used for ShadowRoot and XBL.
Expand Down
2 changes: 1 addition & 1 deletion components/style/bezier.rs
Expand Up @@ -8,7 +8,7 @@

#![deny(missing_docs)]

use values::CSSFloat;
use crate::values::CSSFloat;

const NEWTON_METHOD_ITERATIONS: u8 = 8;

Expand Down
2 changes: 1 addition & 1 deletion components/style/bloom.rs
Expand Up @@ -8,7 +8,7 @@
#![deny(missing_docs)]

use atomic_refcell::{AtomicRefCell, AtomicRefMut};
use dom::{SendElement, TElement};
use crate::dom::{SendElement, TElement};
use owning_ref::OwningHandle;
use selectors::bloom::BloomFilter;
use servo_arc::Arc;
Expand Down

0 comments on commit a15d33a

Please sign in to comment.