Skip to content

Commit

Permalink
Added a type annotation (#497)
Browse files Browse the repository at this point in the history
This prevents weird type inference errors
  • Loading branch information
alex authored Nov 10, 2024
1 parent e37fa65 commit 18ef6ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion asn1_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,9 @@ fn generate_read_element(
},
};
if let Some(default) = default {
let f_type = &f.ty;
read_op = quote::quote! {{
asn1::from_optional_default(#read_op, #default.into())#add_error_location?
asn1::from_optional_default::<#f_type>(#read_op, #default.into())#add_error_location?
}};
}
read_op
Expand Down

0 comments on commit 18ef6ea

Please sign in to comment.