mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Avoid returning fmt::Errors for things that are not formatting errors
They are not. The serialization code already checks if the result is empty, which can happen for other reasons. This makes the code a bit more resilient to misuse. Differential Revision: https://phabricator.services.mozilla.com/D115133
This commit is contained in:
parent
4bcf4573db
commit
9c32836913
1 changed files with 2 additions and 2 deletions
|
@ -1486,13 +1486,13 @@ impl ShorthandId {
|
|||
// shorthand, since it only accepts CSS-wide keywords (and
|
||||
// variable references), which will be handled in
|
||||
// get_shorthand_appendable_value.
|
||||
Err(fmt::Error)
|
||||
Ok(())
|
||||
}
|
||||
% for property in data.shorthands_except_all():
|
||||
ShorthandId::${property.camel_case} => {
|
||||
match shorthands::${property.ident}::LonghandsToSerialize::from_iter(declarations) {
|
||||
Ok(longhands) => longhands.to_css(dest),
|
||||
Err(_) => Err(fmt::Error)
|
||||
Err(_) => Ok(())
|
||||
}
|
||||
},
|
||||
% endfor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue