@@ -78,15 +78,15 @@ std::string ToCamelCase(absl::string_view name) {
78
78
return cpp::UnderscoresToCamelCase (name, /* upper initial letter */ true );
79
79
}
80
80
81
- std::string oneofViewEnumRsName (const OneofDescriptor& oneof) {
81
+ std::string OneofViewEnumRsName (const OneofDescriptor& oneof) {
82
82
return ToCamelCase (oneof.name ());
83
83
}
84
84
85
- std::string oneofMutEnumRsName (const OneofDescriptor& oneof) {
85
+ std::string OneofMutEnumRsName (const OneofDescriptor& oneof) {
86
86
return ToCamelCase (oneof.name ()) + " Mut" ;
87
87
}
88
88
89
- std::string oneofCaseEnumName (const OneofDescriptor& oneof) {
89
+ std::string OneofCaseEnumName (const OneofDescriptor& oneof) {
90
90
// Note: This is the name used for the cpp Case enum, we use it for both
91
91
// the Rust Case enum as well as for the cpp case enum in the cpp thunk.
92
92
return ToCamelCase (oneof.name ()) + " Case" ;
@@ -167,8 +167,8 @@ std::string RsTypeNameMut(Context& ctx, const FieldDescriptor& field) {
167
167
168
168
void GenerateOneofDefinition (Context& ctx, const OneofDescriptor& oneof) {
169
169
ctx.Emit (
170
- {{" view_enum_name" , oneofViewEnumRsName (oneof)},
171
- {" mut_enum_name" , oneofMutEnumRsName (oneof)},
170
+ {{" view_enum_name" , OneofViewEnumRsName (oneof)},
171
+ {" mut_enum_name" , OneofMutEnumRsName (oneof)},
172
172
{" view_fields" ,
173
173
[&] {
174
174
for (int i = 0 ; i < oneof.field_count (); ++i) {
@@ -230,7 +230,7 @@ void GenerateOneofDefinition(Context& ctx, const OneofDescriptor& oneof) {
230
230
231
231
// Note: This enum is used as the Thunk return type for getting which case is
232
232
// used: it exactly matches the generate case enum that both cpp and upb use.
233
- ctx.Emit ({{" case_enum_name" , oneofCaseEnumName (oneof)},
233
+ ctx.Emit ({{" case_enum_name" , OneofCaseEnumName (oneof)},
234
234
{" cases" ,
235
235
[&] {
236
236
for (int i = 0 ; i < oneof.field_count (); ++i) {
@@ -258,9 +258,9 @@ void GenerateOneofDefinition(Context& ctx, const OneofDescriptor& oneof) {
258
258
void GenerateOneofAccessors (Context& ctx, const OneofDescriptor& oneof) {
259
259
ctx.Emit (
260
260
{{" oneof_name" , oneof.name ()},
261
- {" view_enum_name" , oneofViewEnumRsName (oneof)},
262
- {" mut_enum_name" , oneofMutEnumRsName (oneof)},
263
- {" case_enum_name" , oneofCaseEnumName (oneof)},
261
+ {" view_enum_name" , OneofViewEnumRsName (oneof)},
262
+ {" mut_enum_name" , OneofMutEnumRsName (oneof)},
263
+ {" case_enum_name" , OneofCaseEnumName (oneof)},
264
264
{" view_cases" ,
265
265
[&] {
266
266
for (int i = 0 ; i < oneof.field_count (); ++i) {
@@ -341,7 +341,7 @@ void GenerateOneofAccessors(Context& ctx, const OneofDescriptor& oneof) {
341
341
void GenerateOneofExternC (Context& ctx, const OneofDescriptor& oneof) {
342
342
ctx.Emit (
343
343
{
344
- {" case_enum_rs_name" , oneofCaseEnumName (oneof)},
344
+ {" case_enum_rs_name" , OneofCaseEnumName (oneof)},
345
345
{" case_thunk" , ThunkName (ctx, oneof, " case" )},
346
346
},
347
347
R"rs(
@@ -353,7 +353,7 @@ void GenerateOneofThunkCc(Context& ctx, const OneofDescriptor& oneof) {
353
353
ctx.Emit (
354
354
{
355
355
{" oneof_name" , oneof.name ()},
356
- {" case_enum_name" , oneofCaseEnumName (oneof)},
356
+ {" case_enum_name" , OneofCaseEnumName (oneof)},
357
357
{" case_thunk" , ThunkName (ctx, oneof, " case" )},
358
358
{" QualifiedMsg" , cpp::QualifiedClassName (oneof.containing_type ())},
359
359
},
0 commit comments