Upgrade to rust-cssparser master.

* Use associated types
* Avoid mutation to gather parsing results.
This commit is contained in:
Simon Sapin 2015-01-28 16:29:35 +01:00
parent 7359f99f20
commit 966af0030a
11 changed files with 183 additions and 165 deletions

View file

@ -1166,16 +1166,12 @@ mod tests {
/// Helper method to get some Rules from selector strings.
/// Each sublist of the result contains the Rules for one StyleRule.
fn get_mock_rules(css_selectors: &[&str]) -> Vec<Vec<Rule>> {
use namespaces::NamespaceMap;
use selectors::parse_selector_list;
use stylesheets::Origin;
css_selectors.iter().enumerate().map(|(i, selectors)| {
let context = ParserContext {
stylesheet_origin: Origin::Author,
namespaces: NamespaceMap::new(),
base_url: &Url::parse("about:blank").unwrap(),
};
let url = Url::parse("about:blank").unwrap();
let context = ParserContext::new(Origin::Author, &url);
parse_selector_list(&context, &mut Parser::new(*selectors))
.unwrap().into_iter().map(|s| {
Rule {