Skip to content

Commit e04a9eb

Browse files
committed
format
1 parent 8ef7ac1 commit e04a9eb

4 files changed

Lines changed: 17 additions & 21 deletions

File tree

‎cpp2rust/converter/converter.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5135,9 +5135,9 @@ std::string Converter::ConvertIRFragment(
51355135
ConvertMappedMethodCall(expr, **mc, bindings, args, num_args, ctx);
51365136
} else if (auto *re =
51375137
std::get_if<std::unique_ptr<RefExprFragment>>(&frag)) {
5138-
result += (*re)->prefix + ' ' +
5139-
ConvertIRFragment((*re)->inner, bindings, expr, args, num_args,
5140-
ctx);
5138+
result +=
5139+
(*re)->prefix + ' ' +
5140+
ConvertIRFragment((*re)->inner, bindings, expr, args, num_args, ctx);
51415141
}
51425142
}
51435143

‎cpp2rust/converter/converter.h‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,6 @@ class Converter : public clang::RecursiveASTVisitor<Converter> {
9494

9595
virtual std::string GetUnboxedDefaultAsString(clang::QualType qual_type);
9696

97-
std::string
98-
ConvertIRFragment(const std::vector<TranslationRule::BodyFragment> &fragments,
99-
llvm::ArrayRef<clang::TemplateArgument> bindings,
100-
clang::Expr *expr, clang::Expr **args, unsigned num_args,
101-
TempMaterializationCtx *ctx);
102-
10397
std::string GetTemplateArgumentAsString(const clang::TemplateArgument &arg);
10498

10599
bool VisitRecoveryExpr(clang::RecoveryExpr *expr);
@@ -304,6 +298,12 @@ class Converter : public clang::RecursiveASTVisitor<Converter> {
304298
std::vector<std::string> materialized_refs_;
305299
};
306300

301+
std::string
302+
ConvertIRFragment(const std::vector<TranslationRule::BodyFragment> &fragments,
303+
llvm::ArrayRef<clang::TemplateArgument> bindings,
304+
clang::Expr *expr, clang::Expr **args, unsigned num_args,
305+
TempMaterializationCtx *ctx);
306+
307307
struct PlaceholderCtx {
308308
unsigned arg_idx;
309309
std::optional<clang::QualType> implicit_convert_to;

‎cpp2rust/converter/models/converter_refcount.cpp‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2996,10 +2996,9 @@ std::string ConverterRefCount::ConvertMappedMethodCall(
29962996
auto param_type = Mapper::GetParamType(*this, expr, arg_idx);
29972997

29982998
if (arg->getType()->isPointerType()) {
2999-
return std::format("{}.with_mut(|__v: {}| __v{})", ConvertPointer(arg),
3000-
param_type,
3001-
ConvertIRFragment(mc.body, bindings, expr, args,
3002-
num_args, ctx));
2999+
return std::format(
3000+
"{}.with_mut(|__v: {}| __v{})", ConvertPointer(arg), param_type,
3001+
ConvertIRFragment(mc.body, bindings, expr, args, num_args, ctx));
30033002
}
30043003

30053004
// A receiver reached through a pointer is modified through it, only for
@@ -3016,8 +3015,7 @@ std::string ConverterRefCount::ConvertMappedMethodCall(
30163015
}
30173016

30183017
auto ptr = pending_deref_.take();
3019-
auto body =
3020-
ConvertIRFragment(mc.body, bindings, expr, args, num_args, ctx);
3018+
auto body = ConvertIRFragment(mc.body, bindings, expr, args, num_args, ctx);
30213019
MarkFresh();
30223020

30233021
return std::format("{}.with_mut(|__v: {}| __v{})", ptr, param_type, body);

‎cpp2rust/converter/models/converter_refcount.h‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,10 @@ class ConverterRefCount final : public Converter {
321321
// converted.
322322
bool in_receiver_ = false;
323323

324-
std::string
325-
ConvertMappedMethodCall(clang::Expr *expr,
326-
const TranslationRule::MethodCallFragment &mc,
327-
llvm::ArrayRef<clang::TemplateArgument> bindings,
328-
clang::Expr **args, unsigned num_args,
329-
TempMaterializationCtx *ctx) override;
324+
std::string ConvertMappedMethodCall(
325+
clang::Expr *expr, const TranslationRule::MethodCallFragment &mc,
326+
llvm::ArrayRef<clang::TemplateArgument> bindings, clang::Expr **args,
327+
unsigned num_args, TempMaterializationCtx *ctx) override;
330328

331329
private:
332330
void SetUFCSReceiver(clang::Expr *base, bool is_arrow,

0 commit comments

Comments
 (0)