mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Set Adjacent::Position case-insensitive
This commit is contained in:
parent
19f9b5bef9
commit
40feb524d9
2 changed files with 6 additions and 5 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue