Set Adjacent::Position case-insensitive

This commit is contained in:
Guillaume Gomez 2016-06-07 18:19:32 +02:00 committed by ggomez
parent 19f9b5bef9
commit 40feb524d9
2 changed files with 6 additions and 5 deletions

View file

@ -129,12 +129,12 @@ pub enum AdjacentPosition {
impl AdjacentPosition { impl AdjacentPosition {
pub fn parse(position: &str) -> Fallible<AdjacentPosition> { pub fn parse(position: &str) -> Fallible<AdjacentPosition> {
match position { match_ignore_ascii_case! { &*position,
"beforebegin" => Ok(AdjacentPosition::BeforeBegin), "beforebegin" => Ok(AdjacentPosition::BeforeBegin),
"afterbegin" => Ok(AdjacentPosition::AfterEnd), "afterbegin" => Ok(AdjacentPosition::AfterBegin),
"beforeend" => Ok(AdjacentPosition::AfterBegin), "beforeend" => Ok(AdjacentPosition::BeforeEnd),
"afterend" => Ok(AdjacentPosition::BeforeEnd), "afterend" => Ok(AdjacentPosition::AfterEnd),
_ => Err(Error::Syntax), _ => Err(Error::Syntax)
} }
} }
} }

View file

@ -39,6 +39,7 @@ extern crate canvas;
extern crate canvas_traits; extern crate canvas_traits;
extern crate caseless; extern crate caseless;
extern crate core; extern crate core;
#[macro_use]
extern crate cssparser; extern crate cssparser;
extern crate devtools_traits; extern crate devtools_traits;
extern crate encoding; extern crate encoding;