From 828200e44bd0a2951dab36c071daa1d8029532c7 Mon Sep 17 00:00:00 2001 From: Techassi Date: Wed, 21 Aug 2024 11:44:09 +0200 Subject: [PATCH] style: Update format_ident call --- .../src/codegen/common/mod.rs | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/crates/stackable-versioned-macros/src/codegen/common/mod.rs b/crates/stackable-versioned-macros/src/codegen/common/mod.rs index ce0de167b..fe13261e7 100644 --- a/crates/stackable-versioned-macros/src/codegen/common/mod.rs +++ b/crates/stackable-versioned-macros/src/codegen/common/mod.rs @@ -58,12 +58,10 @@ pub(crate) fn format_container_from_ident(ident: &Ident) -> Ident { /// /// See [`DEPRECATED_FIELD_PREFIX`]. pub(crate) fn remove_deprecated_field_prefix(ident: &Ident) -> Ident { - format_ident!( - "{}", - ident - .to_string() - .trim_start_matches(DEPRECATED_FIELD_PREFIX) - ) + let ident = ident.to_string(); + let ident = ident.trim_start_matches(DEPRECATED_FIELD_PREFIX); + + format_ident!("{ident}",) } /// Removes the deprecated prefix from a variant ident. @@ -73,11 +71,10 @@ pub(crate) fn remove_deprecated_variant_prefix(ident: &Ident) -> Ident { // NOTE (@Techassi): Currently Clippy only issues a warning for variants // with underscores in their name. That's why we additionally remove the // underscore from the ident to use the expected name during code generation. - format_ident!( - "{}", - ident - .to_string() - .trim_start_matches(DEPRECATED_VARIANT_PREFIX) - .trim_start_matches('_') - ) + let ident = ident.to_string(); + let ident = ident + .trim_start_matches(DEPRECATED_VARIANT_PREFIX) + .trim_start_matches('_'); + + format_ident!("{ident}",) }