Replace some more uses of write! in components/style

This commit is contained in:
Simon Sapin 2017-09-02 19:11:44 +02:00
parent fae2da0f59
commit 5d06c9959f
12 changed files with 33 additions and 28 deletions

View file

@ -327,7 +327,8 @@ impl ToCss for System {
System::Additive => dest.write_str("additive"),
System::Fixed { first_symbol_value } => {
if let Some(value) = first_symbol_value {
write!(dest, "fixed {}", value)
dest.write_str("fixed ")?;
value.to_css(dest)
} else {
dest.write_str("fixed")
}
@ -455,7 +456,7 @@ where W: fmt::Write {
fn bound_to_css<W>(range: Option<i32>, dest: &mut W) -> fmt::Result where W: fmt::Write {
if let Some(finite) = range {
write!(dest, "{}", finite)
finite.to_css(dest)
} else {
dest.write_str("infinite")
}