style: Properly handle exhaustive matches in animation keywords to avoid a warning.

Need to do the gecko_inexhaustive thing because those animation properties have
an EndGuard_ generated by IPDL I suspect.
This commit is contained in:
Emilio Cobos Álvarez 2018-10-27 23:41:30 +02:00
parent 67fae7a2ce
commit 20d9a076d4
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 4 additions and 0 deletions

View file

@ -3000,7 +3000,9 @@ fn static_assert() {
% for value in keyword.gecko_values():
structs::${keyword.gecko_constant(value)} => Keyword::${to_camel_case(value)},
% endfor
% if keyword.gecko_inexhaustive:
_ => panic!("Found unexpected value for animation-${ident}"),
% endif
}
}
${impl_animation_count(ident, gecko_ffi_name)}

View file

@ -247,6 +247,7 @@ ${helpers.single_keyword(
gecko_enum_prefix="PlaybackDirection",
custom_consts=animation_direction_custom_consts,
extra_prefixes=animation_extra_prefixes,
gecko_inexhaustive=True,
spec="https://drafts.csswg.org/css-animations/#propdef-animation-direction",
allowed_in_keyframe_block=False,
)}
@ -271,6 +272,7 @@ ${helpers.single_keyword(
vector=True,
gecko_enum_prefix="FillMode",
extra_prefixes=animation_extra_prefixes,
gecko_inexhaustive=True,
spec="https://drafts.csswg.org/css-animations/#propdef-animation-fill-mode",
allowed_in_keyframe_block=False,
)}