Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signal proto3 optional fields supporting for 2.27 #649

Closed

Conversation

Tim-Zhang
Copy link

It's a backport of #626

fixes #625

Tested this locally via cargo install --force --path . and then running against a protobuf definition containing an optional field via protoc --rust_out=. test.proto where test.proto contained:

syntax = "proto3";

message Test {
  optional string value = 1;
}

The generated code includes the following (note the optional field):

#[derive(PartialEq,Clone,Default)]
pub struct Test {
    // message oneof groups
    pub _value: ::std::option::Option<Test_oneof__value>,
    // special fields
    pub unknown_fields: ::protobuf::UnknownFields,
    pub cached_size: ::protobuf::CachedSize,
}

#[derive(Clone,PartialEq,Debug)]
pub enum Test_oneof__value {
    value(::std::string::String),
}

@Tim-Zhang Tim-Zhang changed the title Signal optional supports for 2.27 Signal proto3 optional fields supporting for 2.27 Aug 18, 2022
@Tim-Zhang
Copy link
Author

@stepancheg may I bother you for a review on this patch?

@Tim-Zhang Tim-Zhang force-pushed the signal-optional-support-2.27 branch from cfd551c to 3cd2525 Compare September 7, 2022 08:23
@stepancheg
Copy link
Owner

Published 2.28.0.

Sorry for delay.

Crate is low maintenance, and looking for a new maintainer.

@stepancheg stepancheg closed this Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants