File tree Expand file tree Collapse file tree
examples/file-descriptor-set Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,19 @@ fn main() {
1111 . no_partial_eq_impl ( true )
1212 . minimal_accessors ( true ) ,
1313 )
14+ // Override minimal accessors setting for specific paths, since the generator calls `set_`
15+ // APIs on specific messages
16+ . configure_many (
17+ & [
18+ ".google.protobuf.DescriptorProto" ,
19+ ".google.protobuf.FieldDescriptorProto" ,
20+ ".google.protobuf.FieldOptions" ,
21+ ".google.protobuf.OneofDescriptorProto" ,
22+ ".google.protobuf.MessageOptions" ,
23+ ".google.protobuf.EnumValueDescriptorProto" ,
24+ ] ,
25+ Config :: new ( ) . minimal_accessors ( false ) ,
26+ )
1427 . compile_protos ( & [ "google/protobuf/descriptor.proto" ] , "descriptor.rs" )
1528 . unwrap ( ) ;
1629}
Original file line number Diff line number Diff line change @@ -484,8 +484,8 @@ config_decl! {
484484 /// Only generate minimal accessors for message types.
485485 ///
486486 /// If enabled, the only accessors that will be generated for this message type will be the
487- /// getter and setter methods on optional fields. This won't reduce the compiled code size, but
488- /// it will significantly reduce the size of the output source file.
487+ /// getter methods on optional fields. This won't reduce the compiled code size, but it will
488+ /// significantly reduce the size of the output source file.
489489 minimal_accessors: Option <bool >,
490490
491491 // General configs
You can’t perform that action at this time.
0 commit comments