Skip to content

Commit 7cd7ae3

Browse files
committed
Add braces around ifs
1 parent 8c35c6d commit 7cd7ae3

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

cpp2rust/converter/translation_rule.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,7 @@ void LoadIrSrc(ExprRules &exprs, TypeRules &types,
166166
const std::filesystem::path &json_path) {
167167
auto buf = llvm::MemoryBuffer::getFile(json_path.string());
168168
if (!buf) {
169-
llvm::errs() << "Missing " << json_path
170-
<< " (run cpp-rule-preprocessor; it is invoked at build "
171-
"time via the cmake check-rules / preprocess-cpp-rules "
172-
"targets)\n";
169+
llvm::errs() << "Missing " << json_path << ", run cpp-rule-preprocessor\n";
173170
assert(0);
174171
return;
175172
}
@@ -183,19 +180,23 @@ void LoadIrSrc(ExprRules &exprs, TypeRules &types,
183180
}
184181

185182
auto *root = parsed->getAsObject();
186-
if (!root)
183+
if (!root) {
187184
return;
185+
}
188186

189187
for (auto &[entry_name, entry_val] : *root) {
190188
auto *obj = entry_val.getAsObject();
191-
if (!obj)
189+
if (!obj) {
192190
continue;
191+
}
193192
auto str = obj->getString("to_string");
194-
if (!str)
193+
if (!str) {
195194
continue;
195+
}
196196
auto name = entry_name.str();
197-
if (name.empty())
197+
if (name.empty()) {
198198
continue;
199+
}
199200
if (name[0] == 'f') {
200201
auto it = exprs.find(name);
201202
if (it != exprs.end()) {

0 commit comments

Comments
 (0)