Skip to content

Commit 24d4be6

Browse files
authored
Fix Formatter::Prettyplease (rust-lang#2505)
The `Formatter::Prettyplease` variant was unavailable because it was kept under a feature that no longer existed.
1 parent 078fb77 commit 24d4be6

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@
186186

187187
## Fixed
188188

189+
* Prettyplease is available as a `Formatter` variant now.
190+
189191
## Security
190192

191193
# 0.65.1

bindgen/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ pub enum Formatter {
171171
None,
172172
/// Use `rustfmt` to format the bindings.
173173
Rustfmt,
174-
#[cfg(feature = "prettyplease")]
175174
/// Use `prettyplease` to format the bindings.
176175
Prettyplease,
177176
}
@@ -189,7 +188,6 @@ impl FromStr for Formatter {
189188
match s {
190189
"none" => Ok(Self::None),
191190
"rustfmt" => Ok(Self::Rustfmt),
192-
#[cfg(feature = "prettyplease")]
193191
"prettyplease" => Ok(Self::Prettyplease),
194192
_ => Err(format!("`{}` is not a valid formatter", s)),
195193
}
@@ -201,7 +199,6 @@ impl std::fmt::Display for Formatter {
201199
let s = match self {
202200
Self::None => "none",
203201
Self::Rustfmt => "rustfmt",
204-
#[cfg(feature = "prettyplease")]
205202
Self::Prettyplease => "prettyplease",
206203
};
207204

@@ -966,8 +963,6 @@ impl Bindings {
966963

967964
match self.options.formatter {
968965
Formatter::None => return Ok(tokens.to_string()),
969-
970-
#[cfg(feature = "prettyplease")]
971966
Formatter::Prettyplease => {
972967
return Ok(prettyplease::unparse(&syn::parse_quote!(#tokens)));
973968
}

0 commit comments

Comments
 (0)