mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Simplify Debug impl for PropertyDeclaration reusing to_css.
These two functions appear in the data from bug 1328497. I think the way to fix this is another one (either using static arrays to get the interesting data, or making rust generate the equivalent code).
This commit is contained in:
parent
68ecb04847
commit
c8ea840106
1 changed files with 1 additions and 11 deletions
|
@ -842,17 +842,7 @@ impl fmt::Debug for PropertyDeclaration {
|
|||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
try!(self.id().to_css(f));
|
||||
try!(f.write_str(": "));
|
||||
match *self {
|
||||
% for property in data.longhands:
|
||||
% if not property.derived_from:
|
||||
PropertyDeclaration::${property.camel_case}(ref value) => value.to_css(f),
|
||||
% endif
|
||||
% endfor
|
||||
PropertyDeclaration::Custom(_, ref value) => value.to_css(f),
|
||||
% if any(property.derived_from for property in data.longhands):
|
||||
_ => Err(fmt::Error),
|
||||
% endif
|
||||
}
|
||||
self.to_css(f)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue