Skip to content

Commit

Permalink
This is a field variant
Browse files Browse the repository at this point in the history
  • Loading branch information
dfithian committed Dec 17, 2024
1 parent bad4f85 commit 4b31458
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion prost-build/src/code_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ impl<C: ConfigCallbacks> CodeGenerator<'_, C> {
ty_tag,
field.descriptor.number()
));
self.append_field_attributes(self.package.to_string(), &oneof_name, descriptor.clone(), field.descriptor.name().to_string(), FieldDescriptor::OneofVariant(field.descriptor.clone()));
self.append_field_attributes(self.package.to_string(), &oneof_name, descriptor.clone(), field.descriptor.name().to_string(), FieldDescriptor::Field(ty_tag.to_string(), field.descriptor.clone()));

self.push_indent();
let ty = self.resolve_type(&field.descriptor, fq_message_name);
Expand Down
2 changes: 0 additions & 2 deletions prost-build/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ pub struct Attribute {
pub enum FieldDescriptor {
/// A message's field.
Field(String, FieldDescriptorProto),
/// A oneof's variant.
OneofVariant(FieldDescriptorProto),
/// A map's field.
MapField(String, String, FieldDescriptorProto),
/// A oneof field.
Expand Down

0 comments on commit 4b31458

Please sign in to comment.