Use atom! in place of Atom::from_slice where necessary

This commit is contained in:
Manish Goregaokar 2014-11-22 16:07:55 +05:30
parent e6e73b8da7
commit 534919327d
4 changed files with 6 additions and 8 deletions

View file

@ -1230,7 +1230,7 @@ mod tests {
fn test_get_id_name(){
let rules_list = get_mock_rules([".intro", "#top"]);
assert_eq!(SelectorMap::get_id_name(&rules_list[0][0]), None);
assert_eq!(SelectorMap::get_id_name(&rules_list[1][0]), Some(Atom::from_slice("top")));
assert_eq!(SelectorMap::get_id_name(&rules_list[1][0]), Some(atom!("top")));
}
#[test]
@ -1260,7 +1260,7 @@ mod tests {
let rules_list = get_mock_rules([".intro.foo", "#top"]);
let mut selector_map = SelectorMap::new();
selector_map.insert(rules_list[1][0].clone());
assert_eq!(1, selector_map.id_hash.find(&Atom::from_slice("top")).unwrap()[0].declarations.source_order);
assert_eq!(1, selector_map.id_hash.find(&atom!("top")).unwrap()[0].declarations.source_order);
selector_map.insert(rules_list[0][0].clone());
assert_eq!(0, selector_map.class_hash.find(&Atom::from_slice("intro")).unwrap()[0].declarations.source_order);
assert!(selector_map.class_hash.find(&Atom::from_slice("foo")).is_none());