Skip to content

Commit f4b9c0c

Browse files
committed
Merge remote-tracking branch 'origin/main' into ql_gen
2 parents 1115258 + 24b4586 commit f4b9c0c

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

extractor/src/extractor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,13 @@ impl Visitor<'_> {
229229
)
230230
}
231231
}
232-
Storage::Table { index } => {
233-
for child_id in child_ids {
232+
Storage::Table => {
233+
for (index, child_id) in child_ids.iter().enumerate() {
234234
self.trap_output.push(TrapEntry::ChildOf(
235235
node_type_name(&field.parent.kind, field.parent.named),
236236
parent_id,
237237
field.get_name(),
238-
Index(*index),
238+
Index(index),
239239
*child_id,
240240
));
241241
}

generator/src/ql_gen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ fn create_field_getters(
400400
*main_table_column_index += 1;
401401
result
402402
}
403-
node_types::Storage::Table { index: _ } => {
403+
node_types::Storage::Table => {
404404
let field_table_name = format!("{}_{}", parent_name, &field.get_name());
405405
(
406406
ql::Predicate {

node-types/src/lib.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ pub enum Storage {
4747
/// the field is stored as a column in the parent table
4848
Column,
4949
// the field is store in a link table
50-
Table {
51-
index: usize,
52-
},
50+
Table,
5351
}
5452

5553
pub fn read_node_types(node_types_path: &Path) -> std::io::Result<Vec<Entry>> {
@@ -132,9 +130,7 @@ fn add_field(
132130
} else {
133131
// This field can appear zero or multiple times, so put
134132
// it in an auxiliary table.
135-
storage = Storage::Table {
136-
index: fields.len(),
137-
};
133+
storage = Storage::Table;
138134
}
139135
fields.push(Field {
140136
parent: TypeName {

0 commit comments

Comments
 (0)