diff options
author | Ben Boeckel <mathstuf@gmail.com> | 2021-10-25 07:48:42 -0400 |
---|---|---|
committer | Ben Boeckel <mathstuf@gmail.com> | 2021-10-25 08:14:55 -0400 |
commit | 1d3a36276a07a7472ed39499a2c9ddce37146d93 (patch) | |
tree | 2559822b214026dff3e706f80bec551bfde33e6c /gcc/rust/resolve/rust-ast-resolve-expr.h | |
parent | 868d3125d326a6800376411fb6699d984cfa7101 (diff) | |
download | gcc-1d3a36276a07a7472ed39499a2c9ddce37146d93.zip gcc-1d3a36276a07a7472ed39499a2c9ddce37146d93.tar.gz gcc-1d3a36276a07a7472ed39499a2c9ddce37146d93.tar.bz2 |
gccrs: StructExprStructFields: remove `iterate` method
This provides a getter for the set of fields in a struct expression
rather than a visitor with a callback which is more complicated for
callers, especially static analysis.
Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-expr.h')
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-expr.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.h b/gcc/rust/resolve/rust-ast-resolve-expr.h index 2aa7afd..48906f5 100644 --- a/gcc/rust/resolve/rust-ast-resolve-expr.h +++ b/gcc/rust/resolve/rust-ast-resolve-expr.h @@ -269,11 +269,12 @@ public: struct_expr.get_node_id ()); } - struct_expr.iterate ( - [&] (AST::StructExprField *struct_field) mutable -> bool { - ResolveStructExprField::go (struct_field, struct_expr.get_node_id ()); - return true; - }); + auto const &struct_fields = struct_expr.get_fields (); + for (auto &struct_field : struct_fields) + { + ResolveStructExprField::go (struct_field.get (), + struct_expr.get_node_id ()); + } } void visit (AST::GroupedExpr &expr) override |