]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: collector: Reformat trait impl
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 28 Jun 2023 12:33:36 +0000 (14:33 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:49:33 +0000 (18:49 +0100)
Trait impl were not readable, hence the reformat.

gcc/rust/ChangeLog:

* ast/rust-ast-collector.cc (TokenCollector::visit): Reformat
trait impl block.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-ast-collector.cc

index f85d194d5c27fe11d4e9303c522b9ecb8746c574..ffd5311caa16a55877510dc9a8da5776a46d9d2f 100644 (file)
@@ -2157,22 +2157,7 @@ TokenCollector::visit (TraitImpl &impl)
   visit (impl.get_trait_path ());
   push (Rust::Token::make (FOR, Location ()));
   visit (impl.get_type ());
-  push (Rust::Token::make (LEFT_CURLY, Location ()));
-  newline ();
-
-  increment_indentation ();
-
-  for (auto &item : impl.get_impl_items ())
-    {
-      indentation ();
-      visit (item);
-    }
-
-  decrement_indentation ();
-  newline ();
-
-  push (Rust::Token::make (RIGHT_CURLY, Location ()));
-  newline ();
+  visit_items_as_block (impl.get_impl_items ());
 }
 
 void