Implement ToCss for str and String

This commit is contained in:
Anthony Ramine 2017-06-07 21:00:35 +02:00
parent 12dca42dd7
commit c8c6f3482f
12 changed files with 40 additions and 75 deletions

View file

@ -7,8 +7,8 @@
//! [counter-style]: https://drafts.csswg.org/css-counter-styles/
use Atom;
use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser, Parser, Token};
use cssparser::{serialize_string, serialize_identifier};
use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser};
use cssparser::{Parser, Token, serialize_identifier};
#[cfg(feature = "gecko")] use gecko::rules::CounterStyleDescriptors;
#[cfg(feature = "gecko")] use gecko_bindings::structs::nsCSSCounterDesc;
use parser::{ParserContext, log_css_error, Parse};
@ -361,7 +361,7 @@ impl Parse for Symbol {
impl ToCss for Symbol {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
match *self {
Symbol::String(ref s) => serialize_string(s, dest),
Symbol::String(ref s) => s.to_css(dest),
Symbol::Ident(ref s) => serialize_identifier(s, dest),
}
}