Bug 1736129 - Make #[css(represents_keyword)] convert underscore in the field name to dash. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D128668
This commit is contained in:
Mats Palmgren 2021-10-16 20:09:24 +00:00
parent 37373cdeed
commit cce3f3a286

View file

@ -203,7 +203,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)?;