From 66832f312a7db436110a3b08ff51eac349d5fdbf Mon Sep 17 00:00:00 2001 From: Kadoi Takemaru Date: Sun, 31 Oct 2021 22:22:21 +0900 Subject: Get rid of lambda within AST::TypePath and provide a method to return a reference Remove lambda expressions within AST::TypePath and use get_segments() to iterate over AST::TypePathSegment Fixes #718 Signed-off-by: Kadoi Takemaru --- gcc/rust/ast/rust-path.h | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'gcc/rust/ast/rust-path.h') diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust/ast/rust-path.h index cc2721d..4c437cc 100644 --- a/gcc/rust/ast/rust-path.h +++ b/gcc/rust/ast/rust-path.h @@ -754,15 +754,6 @@ public: } size_t get_num_segments () const { return segments.size (); } - - void iterate_segments (std::function cb) - { - for (auto it = segments.begin (); it != segments.end (); it++) - { - if (!cb ((*it).get ())) - return; - } - } }; struct QualifiedPathType @@ -1029,15 +1020,6 @@ public: } Location get_locus () const override final { return locus; } - - void iterate_segments (std::function cb) - { - for (auto it = segments.begin (); it != segments.end (); it++) - { - if (!cb ((*it).get ())) - return; - } - } }; } // namespace AST } // namespace Rust -- cgit v1.1