From 9c32836913ac6cec88559fefd57dcc6b41b8a4af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 21 May 2023 21:31:15 +0200 Subject: [PATCH] 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 --- components/style/properties/properties.mako.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 71bf6f1e78a..b8a9255db48 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -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