Skip to content

Commit 2108a9e

Browse files
authored
Make clearer how to use prettyplease (#2468)
1 parent 4d2986c commit 2108a9e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,13 @@
164164
## Added
165165
* Added the `Bindgen::default_visibility` nethod and the
166166
`--default-visibility` flag to set the default visibility of fields.
167-
* Added the `--formatter` flag with the values `none`, `rustfmt` and
167+
* Added the `--formatter` CLI flag with the values `none`, `rustfmt` and
168168
`prettyplease` to select which tool will be used to format the bindings. The
169169
default value is `rustfmt`.
170+
* Added the `Builder::formatter` method and the `Formatter` type to select
171+
which tool will be used to format the bindings. The
172+
`Formatter::Prettyplease` variant is only available if the
173+
`"prettyplease"` feature is enabled.
170174
## Changed
171175
* Static functions with no arguments use `void` as their single argument
172176
instead of having no arguments when the `--wrap-static-fns` flag is used.

bindgen/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,6 +1667,9 @@ impl Builder {
16671667
}
16681668

16691669
/// Set which tool should be used to format the generated bindings.
1670+
///
1671+
/// To be able to choose `prettyplease` as a formatter, the `"prettyplease"` feature must be
1672+
/// enabled.
16701673
pub fn formatter(mut self, formatter: Formatter) -> Self {
16711674
self.options.formatter = formatter;
16721675
self

0 commit comments

Comments
 (0)