]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: converter: Fix some styling issues
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Fri, 5 May 2023 12:34:09 +0000 (14:34 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:37:18 +0000 (18:37 +0100)
Fix multiple issues regarding style around loops and conditions with one
single element.

gcc/rust/ChangeLog:

* util/rust-token-converter.cc (convert): Fix style.
(from_ident): Likewise.

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

index 53168b68ad4695c0ae905d9f41b83d5a914a08e9..d5cb450eb9f1f11f13313e573debd965e1a1c707 100644 (file)
@@ -244,10 +244,8 @@ convert (const std::vector<const_TokenPtr> &tokens)
            auto str = token->as_string ();
            auto it = str.cbegin ();
            for (; it != str.cend () - 1; it++)
-             {
-               trees.back ().push (ProcMacro::TokenTree::make_tokentree (
-                 ProcMacro::Punct::make_punct (*it, ProcMacro::JOINT)));
-             }
+             trees.back ().push (ProcMacro::TokenTree::make_tokentree (
+               ProcMacro::Punct::make_punct (*it, ProcMacro::JOINT)));
            trees.back ().push (ProcMacro::TokenTree::make_tokentree (
              ProcMacro::Punct::make_punct (*it, ProcMacro::ALONE)));
          }
@@ -315,9 +313,7 @@ from_ident (const ProcMacro::Ident &ident, std::vector<const_TokenPtr> &result)
 {
   std::string value (reinterpret_cast<const char *> (ident.val), ident.len);
   if (ident.is_raw)
-    {
-      value = "r#" + value;
-    }
+    value = "r#" + value;
 
   // TODO: Inject span -> for now spans are not stored in Ident, once changed
   // the span should be injected in the built token below.