Open gwbres opened 6 months ago
Hello,
It would be great if the code generator would auto implement From<> anytime it encounters a protobuf::oneof.
From<>
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), } } }
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