Skip to content

Commit 72dffeb

Browse files
committed
Small fixes
1 parent f1283e6 commit 72dffeb

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

examples/file-descriptor-set/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fn main() {
99
Config::new()
1010
.no_clone_impl(true)
1111
.no_partial_eq_impl(true)
12-
.minimal_accessors(true),
12+
.no_accessors(true),
1313
)
1414
// Override minimal accessors setting for specific paths, since the generator calls `set_`
1515
// APIs on specific messages
@@ -22,7 +22,7 @@ fn main() {
2222
".google.protobuf.MessageOptions",
2323
".google.protobuf.EnumValueDescriptorProto",
2424
],
25-
Config::new().minimal_accessors(false),
25+
Config::new().no_accessors(false),
2626
)
2727
.compile_protos(&["google/protobuf/descriptor.proto"], "descriptor.rs")
2828
.unwrap();

micropb-gen/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -952,15 +952,15 @@ impl Generator {
952952
self
953953
}
954954

955-
/// Do not generate code to calculate the `MAX_SIZE` constant on each message.
955+
/// Determine whether to generate code to calculate the `MAX_SIZE` constant on each message.
956956
///
957957
/// By default, `micropb-gen` generates code to calculate the `MAX_SIZE` associated constant
958958
/// for each message struct, which determines the max buffer size needed to encode it. If this
959959
/// is set to false, then it replaces the calculations with `None`, effectively disabling the
960960
/// use of `MAX_SIZE`. This has no runtime impact, but it can reduce the size of the output
961961
/// file.
962-
pub fn calculate_max_size(&mut self) -> &mut Self {
963-
self.calculate_max_size = true;
962+
pub fn calculate_max_size(&mut self, flag: bool) -> &mut Self {
963+
self.calculate_max_size = flag;
964964
self
965965
}
966966
}

0 commit comments

Comments
 (0)