- if let Some(description) = metadata.description {
- // Do things
- }
+ if let Some(OptionalDescription::Description(description)) =
+ metadata.optional_description
+ {
+ // Do things
+ }
Not great, not terrible.
And technically, those who want use optional can just use an alternative .proto, as it's all compatible on the wire anyway.
Alternative implementation that remains wire-protocol compatible. Turns out it's actually source compatible when using python, which is good.
Example of the "clunkyness" of using it in Rust (and probably C++).
Not great, not terrible.
And technically, those who want use
optional
can just use an alternative.proto
, as it's all compatible on the wire anyway.