Skip to content

Commit 869b92b

Browse files
committed
Address reviews
1 parent 73e1d12 commit 869b92b

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎cpp2rust/converter/converter.cpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,7 @@ Converter::MaterializeTemp(const std::string &binding_name,
237237
auto pointee = param_type.getNonReferenceType();
238238
auto value = ConvertRValue(expr, pointee);
239239
auto type_str = ToStringBase(pointee);
240-
auto decl = in_const_initializer_ ? std::string("pub ") + keyword::kStatic
241-
: keyword::kLet;
240+
const char *decl = in_const_initializer_ ? "pub static" : keyword::kLet;
242241

243242
auto binding =
244243
std::format("{} mut {} : {} = {};", decl, binding_name, type_str, value);

‎cpp2rust/converter/models/converter_refcount.cpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,7 @@ ConverterRefCount::MaterializeTemp(const std::string &binding_name,
368368
auto pointee = param_type.getNonReferenceType();
369369
auto value = ConvertRValue(expr, pointee);
370370
auto type_str = ToStringBase(pointee);
371-
auto decl = in_const_initializer_ ? std::string("pub ") + keyword::kStatic
372-
: keyword::kLet;
371+
const char *decl = in_const_initializer_ ? "pub static" : keyword::kLet;
373372

374373
auto binding = std::format("{} {} : Value<{}> = Rc::new(RefCell::new({}));",
375374
decl, binding_name, type_str, value);

0 commit comments

Comments
 (0)