Skip to content

Commit 68d76f6

Browse files
authored
chore(codecs-derive): update should_use_alt_impl (paradigmxyz#11148)
1 parent f9b8dc4 commit 68d76f6

File tree

1 file changed

+3
-3
lines changed
  • crates/storage/codecs/derive/src/compact

1 file changed

+3
-3
lines changed

crates/storage/codecs/derive/src/compact/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ fn load_field_from_segments(
141141
}
142142

143143
if is_enum {
144-
fields.push(FieldTypes::EnumUnnamedField((ftype.to_string(), use_alt_impl)));
144+
fields.push(FieldTypes::EnumUnnamedField((ftype, use_alt_impl)));
145145
} else {
146146
let should_compact = is_flag_type(&ftype) ||
147147
field.attrs.iter().any(|attr| {
@@ -162,8 +162,8 @@ fn load_field_from_segments(
162162
/// Vec/Option we try to find out if it's a Vec/Option of a fixed size data type, e.g. `Vec<B256>`.
163163
///
164164
/// If so, we use another impl to code/decode its data.
165-
fn should_use_alt_impl(ftype: &String, segment: &syn::PathSegment) -> bool {
166-
if *ftype == "Vec" || *ftype == "Option" {
165+
fn should_use_alt_impl(ftype: &str, segment: &syn::PathSegment) -> bool {
166+
if ftype == "Vec" || ftype == "Option" {
167167
if let syn::PathArguments::AngleBracketed(ref args) = segment.arguments {
168168
if let Some(syn::GenericArgument::Type(syn::Type::Path(arg_path))) = args.args.last() {
169169
if let (Some(path), 1) =

0 commit comments

Comments
 (0)