Skip to content

Commit 8d9e8d9

Browse files
committed
Use kMaxGenerics instead of raw integer literal
1 parent 0baa9ff commit 8d9e8d9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cpp2rust/converter/mapper.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ matchTemplate(const std::string &template_str,
341341
// result = "Vec<i32>"
342342
std::string instantiateTgt(const std::vector<std::string> &types,
343343
const std::string &tgt_template) {
344-
assert(types.size() <= 9);
344+
assert(types.size() <= TranslationRule::kMaxGenerics &&
345+
"template placeholder exceeds kMaxGenerics");
345346
std::string instantiated_template = tgt_template;
346347
std::string::size_type pos = 0;
347348
while ((pos = instantiated_template.find('T', pos)) != std::string::npos) {

0 commit comments

Comments
 (0)