style: Make #[css(represents_keyword)] convert underscore in the field name to dash

Differential Revision: https://phabricator.services.mozilla.com/D128668
This commit is contained in:
Mats Palmgren 2023-06-09 10:20:04 +02:00 committed by Oriol Brufau
parent 1bd1441d0b
commit 155fbf8804

View file

@ -208,7 +208,7 @@ fn derive_single_field_expr(
.ident
.as_ref()
.expect("Unnamed field with represents_keyword?");
let ident = cg::to_css_identifier(&ident.to_string());
let ident = cg::to_css_identifier(&ident.to_string()).replace("_", "-");
quote! {
if *#field {
writer.raw_item(#ident)?;