mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -215,15 +215,14 @@ impl ToCss for Expression {
|
|||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result
|
||||
where W: fmt::Write,
|
||||
{
|
||||
write!(dest, "(")?;
|
||||
let (mm, l) = match self.0 {
|
||||
ExpressionKind::Width(Range::Min(ref l)) => ("min-", l),
|
||||
ExpressionKind::Width(Range::Max(ref l)) => ("max-", l),
|
||||
ExpressionKind::Width(Range::Eq(ref l)) => ("", l),
|
||||
let (s, l) = match self.0 {
|
||||
ExpressionKind::Width(Range::Min(ref l)) => ("(min-width: ", l),
|
||||
ExpressionKind::Width(Range::Max(ref l)) => ("(max-width: ", l),
|
||||
ExpressionKind::Width(Range::Eq(ref l)) => ("(width: ", l),
|
||||
};
|
||||
write!(dest, "{}width: ", mm)?;
|
||||
dest.write_str(s)?;
|
||||
l.to_css(dest)?;
|
||||
write!(dest, ")")
|
||||
dest.write_char(')')
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue