Skip to content

Commit

Permalink
Fix Formatter::Prettyplease (rust-lang#2505)
Browse files Browse the repository at this point in the history
The `Formatter::Prettyplease` variant was unavailable because it was kept under a feature that no longer existed.
  • Loading branch information
vorot93 authored Apr 17, 2023
1 parent 078fb77 commit 24d4be6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@

## Fixed

* Prettyplease is available as a `Formatter` variant now.

## Security

# 0.65.1
Expand Down
5 changes: 0 additions & 5 deletions bindgen/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ pub enum Formatter {
None,
/// Use `rustfmt` to format the bindings.
Rustfmt,
#[cfg(feature = "prettyplease")]
/// Use `prettyplease` to format the bindings.
Prettyplease,
}
Expand All @@ -189,7 +188,6 @@ impl FromStr for Formatter {
match s {
"none" => Ok(Self::None),
"rustfmt" => Ok(Self::Rustfmt),
#[cfg(feature = "prettyplease")]
"prettyplease" => Ok(Self::Prettyplease),
_ => Err(format!("`{}` is not a valid formatter", s)),
}
Expand All @@ -201,7 +199,6 @@ impl std::fmt::Display for Formatter {
let s = match self {
Self::None => "none",
Self::Rustfmt => "rustfmt",
#[cfg(feature = "prettyplease")]
Self::Prettyplease => "prettyplease",
};

Expand Down Expand Up @@ -966,8 +963,6 @@ impl Bindings {

match self.options.formatter {
Formatter::None => return Ok(tokens.to_string()),

#[cfg(feature = "prettyplease")]
Formatter::Prettyplease => {
return Ok(prettyplease::unparse(&syn::parse_quote!(#tokens)));
}
Expand Down

0 comments on commit 24d4be6

Please sign in to comment.