mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Utilize match_ignore_ascii_case! in more places.
This commit is contained in:
parent
6238035612
commit
befe538472
5 changed files with 39 additions and 46 deletions
|
@ -3,7 +3,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::activation::Activatable;
|
||||
use std::ascii::AsciiExt;
|
||||
use dom::bindings::codegen::Bindings::DOMTokenListBinding::DOMTokenListMethods;
|
||||
use dom::bindings::codegen::Bindings::HTMLAreaElementBinding;
|
||||
use dom::bindings::codegen::Bindings::HTMLAreaElementBinding::HTMLAreaElementMethods;
|
||||
|
@ -241,13 +240,13 @@ impl HTMLAreaElement {
|
|||
pub fn get_shape_from_coords(&self) -> Option<Area> {
|
||||
let elem = self.upcast::<Element>();
|
||||
let shape = elem.get_string_attribute(&"shape".into());
|
||||
let shp: Shape = match &shape {
|
||||
s if s.eq_ignore_ascii_case("circle") => Shape::Circle,
|
||||
s if s.eq_ignore_ascii_case("circ") => Shape::Circle,
|
||||
s if s.eq_ignore_ascii_case("rectangle") => Shape::Rectangle,
|
||||
s if s.eq_ignore_ascii_case("rect") => Shape::Rectangle,
|
||||
s if s.eq_ignore_ascii_case("polygon") => Shape::Rectangle,
|
||||
s if s.eq_ignore_ascii_case("poly") => Shape::Polygon,
|
||||
let shp: Shape = match_ignore_ascii_case! { &shape,
|
||||
"circle" => Shape::Circle,
|
||||
"circ" => Shape::Circle,
|
||||
"rectangle" => Shape::Rectangle,
|
||||
"rect" => Shape::Rectangle,
|
||||
"polygon" => Shape::Rectangle,
|
||||
"poly" => Shape::Polygon,
|
||||
_ => return None,
|
||||
};
|
||||
if elem.has_attribute(&"coords".into()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue