chaokunyang commented on code in PR #3092:
URL: https://github.com/apache/fory/pull/3092#discussion_r2647147392


##########
rust/fory-derive/src/util.rs:
##########
@@ -17,38 +17,73 @@
 
 use syn::{Field, Fields, GenericArgument, PathArguments, Type, TypePath, 
TypeTraitObject};
 
-pub fn sorted_fields(fields: &Fields) -> Vec<&Field> {
-    let fields = fields.iter().collect::<Vec<&Field>>();
+/// Sorted field with its original index preserved.
+///
+/// For tuple structs, `original_index` is the field's position in the original
+/// struct definition (0, 1, 2, ...), which is used as the field name.
+#[derive(Clone, Copy)]
+pub struct SortedField<'a> {

Review Comment:
   This cames to my mind at first. But we may add more info to this struct, 
`IndexedField` may looks vargue in the future.



-- 
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]

Reply via email to