Use ascii_case_insensitive_phf_map! in PropertyId::parse

This commit is contained in:
Simon Sapin 2017-02-25 19:00:29 +01:00
parent 33ef6f78e5
commit 2f996e34f5
7 changed files with 21 additions and 69 deletions

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use std::borrow::Cow;
use style::str::{split_html_space_chars, str_join, cow_into_ascii_lowercase};
use style::str::{split_html_space_chars, str_join};
#[test]
pub fn split_html_space_chars_whitespace() {
@ -34,13 +34,3 @@ pub fn test_str_join_many() {
let expected = "-alpha--beta-gamma-";
assert_eq!(actual, expected);
}
#[test]
pub fn test_cow_into_ascii_lowercase() {
assert!(matches!(cow_into_ascii_lowercase("abc.d"), Cow::Borrowed("abc.d")));
let string = String::from("abc.d");
assert!(matches!(cow_into_ascii_lowercase(string), Cow::Owned(ref s) if s == "abc.d"));
assert!(matches!(cow_into_ascii_lowercase("Abc.d"), Cow::Owned(ref s) if s == "abc.d"));
assert!(matches!(cow_into_ascii_lowercase("aBC.D"), Cow::Owned(ref s) if s == "abc.d"));
assert!(matches!(cow_into_ascii_lowercase("abc.D"), Cow::Owned(ref s) if s == "abc.d"));
}