summaryrefslogtreecommitdiff
path: root/macros/src/util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'macros/src/util.rs')
-rw-r--r--macros/src/util.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/macros/src/util.rs b/macros/src/util.rs
index d94ba932..53a8354e 100644
--- a/macros/src/util.rs
+++ b/macros/src/util.rs
@@ -1,3 +1,5 @@
+use heck::ToKebabCase;
+
use super::*;
/// Return an error at the given item.
@@ -55,7 +57,7 @@ pub fn validate_attrs(attrs: &[syn::Attribute]) -> Result<()> {
/// Convert an identifier to a kebab-case string.
pub fn kebab_case(name: &Ident) -> String {
- name.to_string().to_lowercase().replace('_', "-")
+ name.to_string().to_kebab_case()
}
/// Extract documentation comments from an attribute list.