chaokunyang commented on code in PR #3092:
URL: https://github.com/apache/fory/pull/3092#discussion_r2647139734
##########
rust/fory-derive/src/object/read.rs:
##########
@@ -593,28 +627,29 @@ pub fn gen_read_with_type_info() -> TokenStream {
}
}
-pub fn gen_read_compatible(fields: &[&Field]) -> TokenStream {
- gen_read_compatible_with_construction(fields, None)
+pub fn gen_read_compatible(sorted_fields: &[SortedField<'_>]) -> TokenStream {
+ gen_read_compatible_with_construction(sorted_fields, None)
}
pub(crate) fn gen_read_compatible_with_construction(
- fields: &[&Field],
+ sorted_fields: &[SortedField<'_>],
variant_ident: Option<&Ident>,
) -> TokenStream {
- let declare_ts: Vec<TokenStream> = declare_var(fields);
- let assign_ts: Vec<TokenStream> = assign_value(fields);
+ let fields: Vec<&Field> = sorted_fields.iter().map(|sf|
sf.field).collect();
+ let declare_ts: Vec<TokenStream> = declare_var_sorted(sorted_fields);
+ let assign_ts: Vec<TokenStream> = assign_value_sorted(sorted_fields);
Review Comment:
Maybe we should remove sorted for thoose methods and variables
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]