mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Replace some more uses of write!
in components/style
This commit is contained in:
parent
fae2da0f59
commit
5d06c9959f
12 changed files with 33 additions and 28 deletions
|
@ -68,7 +68,7 @@ impl Parse for SingleValue {
|
|||
|
||||
impl ToCss for SingleValue {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
write!(dest, "{}", self.0)
|
||||
self.0.to_css(dest)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,9 +105,10 @@ impl Parse for PairValues {
|
|||
|
||||
impl ToCss for PairValues {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
write!(dest, "{}", self.0)?;
|
||||
self.0.to_css(dest)?;
|
||||
if let Some(second) = self.1 {
|
||||
write!(dest, " {}", second)?;
|
||||
dest.write_char(' ')?;
|
||||
second.to_css(dest)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -158,10 +159,10 @@ impl ToCss for VectorValues {
|
|||
let mut iter = self.0.iter();
|
||||
let first = iter.next();
|
||||
if let Some(first) = first {
|
||||
write!(dest, "{}", first)?;
|
||||
first.to_css(dest)?;
|
||||
for value in iter {
|
||||
dest.write_str(" ")?;
|
||||
write!(dest, "{}", value)?;
|
||||
dest.write_char(' ')?;
|
||||
value.to_css(dest)?;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue