We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
From<>
protobuf::one
Hello,
It would be great if the code generator would auto implement From<> anytime it encounters a protobuf::oneof.
protobuf::oneof
I find myself implementing From<> all the time to simplify how to use the auto generated code.
If I understand correctly, anytime we encounter protobuf::oneof we get an object of this form:
pub struct Object { #[prost(oneof = "inner::Value", tags = xxx)] pub value: ::core:option:Option<inner::Value>, }
So I wind up writing casts like this all the time
impl From<inner::Value::X> for Object { fn from(value: inner::Value::X) -> Object { Object { value: Some(v), } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
It would be great if the code generator would auto implement
From<>
anytime it encounters aprotobuf::oneof
.I find myself implementing
From<>
all the time to simplify how to use the auto generated code.If I understand correctly, anytime we encounter
protobuf::oneof
we get an object of this form:So I wind up writing casts like this all the time
The text was updated successfully, but these errors were encountered: