mirror of
https://github.com/github/codeql.git
synced 2026-04-23 15:55:18 +02:00
Rust: codegen: fix generated code
This commit is contained in:
@@ -35,12 +35,12 @@ impl TrapEntry for {{name}} {
|
||||
{{/is_repeated}}
|
||||
{{/is_optional}}
|
||||
{{#is_repeated}}
|
||||
for (i, &v) in self.{{field_name}}.iter().enumerate() {
|
||||
for (i, v) in self.{{field_name}}.into_iter().enumerate() {
|
||||
{{^is_optional}}
|
||||
out.add_tuple("{{table_name}}", vec![trap::Arg::Label(id){{^is_unordered}}, i.into(){{/is_unordered}}, v.into()]);
|
||||
{{/is_optional}}
|
||||
{{#is_optional}}
|
||||
if let Some(vv) = v {
|
||||
if let Some(v) = v {
|
||||
out.add_tuple("{{table_name}}", vec![trap::Arg::Label(id){{^is_unordered}}, i.into(){{/is_unordered}}, v.into()]);
|
||||
}
|
||||
{{/is_optional}}
|
||||
|
||||
Reference in New Issue
Block a user