Skip to content

Commit 828200e

Browse files
committed
style: Update format_ident call
1 parent 403a649 commit 828200e

File tree

1 file changed

+10
-13
lines changed
  • crates/stackable-versioned-macros/src/codegen/common

1 file changed

+10
-13
lines changed

crates/stackable-versioned-macros/src/codegen/common/mod.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,10 @@ pub(crate) fn format_container_from_ident(ident: &Ident) -> Ident {
5858
///
5959
/// See [`DEPRECATED_FIELD_PREFIX`].
6060
pub(crate) fn remove_deprecated_field_prefix(ident: &Ident) -> Ident {
61-
format_ident!(
62-
"{}",
63-
ident
64-
.to_string()
65-
.trim_start_matches(DEPRECATED_FIELD_PREFIX)
66-
)
61+
let ident = ident.to_string();
62+
let ident = ident.trim_start_matches(DEPRECATED_FIELD_PREFIX);
63+
64+
format_ident!("{ident}",)
6765
}
6866

6967
/// Removes the deprecated prefix from a variant ident.
@@ -73,11 +71,10 @@ pub(crate) fn remove_deprecated_variant_prefix(ident: &Ident) -> Ident {
7371
// NOTE (@Techassi): Currently Clippy only issues a warning for variants
7472
// with underscores in their name. That's why we additionally remove the
7573
// underscore from the ident to use the expected name during code generation.
76-
format_ident!(
77-
"{}",
78-
ident
79-
.to_string()
80-
.trim_start_matches(DEPRECATED_VARIANT_PREFIX)
81-
.trim_start_matches('_')
82-
)
74+
let ident = ident.to_string();
75+
let ident = ident
76+
.trim_start_matches(DEPRECATED_VARIANT_PREFIX)
77+
.trim_start_matches('_');
78+
79+
format_ident!("{ident}",)
8380
}

0 commit comments

Comments
 (0)