Make use of From<String> for Atom

This commit is contained in:
Anthony Ramine 2016-02-24 17:09:49 +01:00
parent 50af73d1a2
commit cc030df36e
7 changed files with 14 additions and 14 deletions

View file

@ -1793,7 +1793,7 @@ pub mod longhands {
value.push_str(" ");
value.push_str(&ident);
}
Ok(FontFamily::FamilyName(Atom::from(&*value)))
Ok(FontFamily::FamilyName(Atom::from(value)))
}
</%self:longhand>

View file

@ -396,7 +396,7 @@ impl<'a, Impl: SelectorImpl> AtRuleParser for TopLevelRuleParser<'a, Impl> {
self.state.set(State::Namespaces);
let prefix = input.try(|input| input.expect_ident()).ok().map(|p| p.into_owned());
let url = Namespace(Atom::from(&*try!(input.expect_url_or_string())));
let url = Namespace(Atom::from(try!(input.expect_url_or_string())));
return Ok(AtRuleType::WithoutBlock(CSSRule::Namespace(prefix, url)))
} else {
return Err(()) // "@namespace must be before any rule but @charset and @import"