aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-05-05 14:34:09 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2023-05-11 09:38:22 +0200
commit39817cc6c962e4cbeb5782415b7194e9906ac18b (patch)
tree48eeb60cbaddfc3280769917d768b214a4abd24a
parent983b11322476bc6cc8e7fe2b9fb3bed5c29219a0 (diff)
downloadgcc-39817cc6c962e4cbeb5782415b7194e9906ac18b.zip
gcc-39817cc6c962e4cbeb5782415b7194e9906ac18b.tar.gz
gcc-39817cc6c962e4cbeb5782415b7194e9906ac18b.tar.bz2
converter: Fix some styling issues
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>
-rw-r--r--gcc/rust/util/rust-token-converter.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/gcc/rust/util/rust-token-converter.cc b/gcc/rust/util/rust-token-converter.cc
index 53168b6..d5cb450 100644
--- a/gcc/rust/util/rust-token-converter.cc
+++ b/gcc/rust/util/rust-token-converter.cc
@@ -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.