Escape 'type' keyword in generated Rust code

Use raw identifiers for fields named "type" to avoid conflicts with the
Rust keyword. Fix field number indexing in tests.
This commit is contained in:
2026-05-03 14:00:20 -07:00
parent b73cbb3dbc
commit a2a5c12235
3 changed files with 25 additions and 4 deletions
+1 -1
View File
@@ -520,7 +520,7 @@ mod tests {
// Validate that fields appear in the expected relative order
let field_numbers: Vec<u32> = acc.fields()
.map(|r| r.expect("Failed to decode field").0.field_number)
.map(|r| r.expect("Failed to decode field").1.field_number)
.collect();
let essential_fields = [1, 2, 3, 14, 16, 20];