Put allow(dead_code) on oneof case enum try_from

This being unused in some cases is causing a warning at head, just suppressing the warning rather than conditionally emitting it only when we need it.

PiperOrigin-RevId: 668937899
pull/18026/head
Protobuf Team Bot 7 months ago committed by Copybara-Service
parent d4a899538a
commit 897be0c738
  1. 1
      src/google/protobuf/compiler/rust/oneof.cc

@ -187,6 +187,7 @@ void GenerateOneofDefinition(Context& ctx, const OneofDescriptor& oneof) {
impl $case_enum_name$ {
//~ This try_from is not a TryFrom impl so that it isn't
//~ committed to as part of our public api.
#[allow(dead_code)]
pub(crate) fn try_from(v: u32) -> Option<$case_enum_name$> {
match v {
0 => Some($case_enum_name$::not_set),

Loading…
Cancel
Save