mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Eliminate warnings
This commit is contained in:
parent
2f46b9aede
commit
dc86e83654
57 changed files with 223 additions and 221 deletions
|
@ -70,7 +70,7 @@ pub fn parse_font_face_rule(rule: AtRule, parent_rules: &mut Vec<CSSRule>, base_
|
|||
let mut maybe_family = None;
|
||||
let mut maybe_sources = None;
|
||||
|
||||
for item in ErrorLoggerIterator(parse_declaration_list(block.move_iter())) {
|
||||
for item in ErrorLoggerIterator(parse_declaration_list(block.into_iter())) {
|
||||
match item {
|
||||
DeclAtRule(rule) => log_css_error(
|
||||
rule.location, format!("Unsupported at-rule in declaration list: @{:s}", rule.name).as_slice()),
|
||||
|
|
|
@ -59,7 +59,7 @@ pub fn parse_media_rule(rule: AtRule, parent_rules: &mut Vec<CSSRule>,
|
|||
}
|
||||
};
|
||||
let mut rules = vec!();
|
||||
for rule in ErrorLoggerIterator(parse_rule_list(block.move_iter())) {
|
||||
for rule in ErrorLoggerIterator(parse_rule_list(block.into_iter())) {
|
||||
match rule {
|
||||
QualifiedRule(rule) => parse_style_rule(rule, &mut rules, namespaces, base_url),
|
||||
AtRule(rule) => parse_nested_at_rule(
|
||||
|
@ -94,13 +94,13 @@ pub fn parse_media_query_list(input: &[ComponentValue]) -> MediaQueryList {
|
|||
};
|
||||
match iter.next() {
|
||||
None => {
|
||||
for mq in mq.move_iter() {
|
||||
for mq in mq.into_iter() {
|
||||
queries.push(mq);
|
||||
}
|
||||
return MediaQueryList{ media_queries: queries }
|
||||
},
|
||||
Some(&Comma) => {
|
||||
for mq in mq.move_iter() {
|
||||
for mq in mq.into_iter() {
|
||||
queries.push(mq);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -229,14 +229,14 @@ pub mod computed {
|
|||
// TODO, as needed: root font size, viewport size, etc.
|
||||
}
|
||||
|
||||
#[allow(non_snake_case_functions)]
|
||||
#[allow(non_snake_case)]
|
||||
#[inline]
|
||||
pub fn compute_Au(value: specified::Length, context: &Context) -> Au {
|
||||
compute_Au_with_font_size(value, context.font_size)
|
||||
}
|
||||
|
||||
/// A special version of `compute_Au` used for `font-size`.
|
||||
#[allow(non_snake_case_functions)]
|
||||
#[allow(non_snake_case)]
|
||||
#[inline]
|
||||
pub fn compute_Au_with_font_size(value: specified::Length, reference_font_size: Au) -> Au {
|
||||
match value {
|
||||
|
@ -254,7 +254,7 @@ pub mod computed {
|
|||
LP_Length(Au),
|
||||
LP_Percentage(CSSFloat),
|
||||
}
|
||||
#[allow(non_snake_case_functions)]
|
||||
#[allow(non_snake_case)]
|
||||
pub fn compute_LengthOrPercentage(value: specified::LengthOrPercentage, context: &Context)
|
||||
-> LengthOrPercentage {
|
||||
match value {
|
||||
|
@ -269,7 +269,7 @@ pub mod computed {
|
|||
LPA_Percentage(CSSFloat),
|
||||
LPA_Auto,
|
||||
}
|
||||
#[allow(non_snake_case_functions)]
|
||||
#[allow(non_snake_case)]
|
||||
pub fn compute_LengthOrPercentageOrAuto(value: specified::LengthOrPercentageOrAuto,
|
||||
context: &Context) -> LengthOrPercentageOrAuto {
|
||||
match value {
|
||||
|
@ -285,7 +285,7 @@ pub mod computed {
|
|||
LPN_Percentage(CSSFloat),
|
||||
LPN_None,
|
||||
}
|
||||
#[allow(non_snake_case_functions)]
|
||||
#[allow(non_snake_case)]
|
||||
pub fn compute_LengthOrPercentageOrNone(value: specified::LengthOrPercentageOrNone,
|
||||
context: &Context) -> LengthOrPercentageOrNone {
|
||||
match value {
|
||||
|
|
|
@ -1438,17 +1438,17 @@ mod property_bit_field {
|
|||
self.storage[bit / uint::BITS] &= !(1 << (bit % uint::BITS))
|
||||
}
|
||||
% for i, property in enumerate(LONGHANDS):
|
||||
#[allow(non_snake_case_functions)]
|
||||
#[allow(non_snake_case)]
|
||||
#[inline]
|
||||
pub fn get_${property.ident}(&self) -> bool {
|
||||
self.get(${i})
|
||||
}
|
||||
#[allow(non_snake_case_functions)]
|
||||
#[allow(non_snake_case)]
|
||||
#[inline]
|
||||
pub fn set_${property.ident}(&mut self) {
|
||||
self.set(${i})
|
||||
}
|
||||
#[allow(non_snake_case_functions)]
|
||||
#[allow(non_snake_case)]
|
||||
#[inline]
|
||||
pub fn clear_${property.ident}(&mut self) {
|
||||
self.clear(${i})
|
||||
|
@ -1484,7 +1484,7 @@ pub fn parse_property_declaration_list<I: Iterator<Node>>(input: I, base_url: &U
|
|||
let mut normal_seen = PropertyBitField::new();
|
||||
let items: Vec<DeclarationListItem> =
|
||||
ErrorLoggerIterator(parse_declaration_list(input)).collect();
|
||||
for item in items.move_iter().rev() {
|
||||
for item in items.into_iter().rev() {
|
||||
match item {
|
||||
DeclAtRule(rule) => log_css_error(
|
||||
rule.location, format!("Unsupported at-rule in declaration list: @{:s}", rule.name).as_slice()),
|
||||
|
|
|
@ -140,7 +140,7 @@ impl SelectorMap {
|
|||
shareable);
|
||||
|
||||
// Sort only the rules we just added.
|
||||
sort::quicksort_by(matching_rules_list.vec_mut_slice_from(init_len), compare);
|
||||
sort::quicksort_by(matching_rules_list.vec_slice_from_mut(init_len), compare);
|
||||
|
||||
fn compare(a: &DeclarationBlock, b: &DeclarationBlock) -> Ordering {
|
||||
(a.specificity, a.source_order).cmp(&(b.specificity, b.source_order))
|
||||
|
@ -1006,7 +1006,7 @@ mod tests {
|
|||
let namespaces = NamespaceMap::new();
|
||||
css_selectors.iter().enumerate().map(|(i, selectors)| {
|
||||
parse_selector_list(tokenize(*selectors).map(|(c, _)| c), &namespaces)
|
||||
.unwrap().move_iter().map(|s| {
|
||||
.unwrap().into_iter().map(|s| {
|
||||
Rule {
|
||||
selector: s.compound_selectors.clone(),
|
||||
declarations: DeclarationBlock {
|
||||
|
|
|
@ -436,7 +436,7 @@ fn parse_qualified_name<I: Iterator<ComponentValue>>(
|
|||
|
||||
fn parse_attribute_selector(content: Vec<ComponentValue>, namespaces: &NamespaceMap)
|
||||
-> Result<SimpleSelector, ()> {
|
||||
let iter = &mut content.move_iter().peekable();
|
||||
let iter = &mut content.into_iter().peekable();
|
||||
let attr = match try!(parse_qualified_name(iter, /* in_attr_selector = */ true, namespaces)) {
|
||||
None => return Err(()),
|
||||
Some((_, None)) => fail!("Implementation error, this should not happen."),
|
||||
|
@ -537,7 +537,7 @@ fn parse_pseudo_element(name: String) -> Result<PseudoElement, ()> {
|
|||
/// Level 3: Parse **one** simple_selector
|
||||
fn parse_negation(arguments: Vec<ComponentValue>, namespaces: &NamespaceMap)
|
||||
-> Result<SimpleSelector, ()> {
|
||||
let iter = &mut arguments.move_iter().peekable();
|
||||
let iter = &mut arguments.into_iter().peekable();
|
||||
match try!(parse_type_selector(iter, namespaces)) {
|
||||
Some(type_selector) => Ok(Negation(type_selector)),
|
||||
None => {
|
||||
|
|
|
@ -129,10 +129,10 @@ pub fn parse_style_rule(rule: QualifiedRule, parent_rules: &mut Vec<CSSRule>,
|
|||
let QualifiedRule{location: location, prelude: prelude, block: block} = rule;
|
||||
// FIXME: avoid doing this for valid selectors
|
||||
let serialized = prelude.iter().to_css();
|
||||
match selectors::parse_selector_list(prelude.move_iter(), namespaces) {
|
||||
match selectors::parse_selector_list(prelude.into_iter(), namespaces) {
|
||||
Ok(selectors) => parent_rules.push(CSSStyleRule(StyleRule{
|
||||
selectors: selectors,
|
||||
declarations: properties::parse_property_declaration_list(block.move_iter(), base_url)
|
||||
declarations: properties::parse_property_declaration_list(block.into_iter(), base_url)
|
||||
})),
|
||||
Err(()) => log_css_error(location, format!(
|
||||
"Invalid/unsupported selector: {}", serialized).as_slice()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue