Skip to content

Remove which dependency #2809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions bindgen-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ log = { version = "0.4", optional = true }
shlex = "1"

[features]
default = ["logging", "runtime", "which-rustfmt"]
default = ["logging", "runtime"]
logging = ["bindgen/logging", "dep:env_logger", "dep:log"]
static = ["bindgen/static"]
runtime = ["bindgen/runtime"]
# Dynamically discover a `rustfmt` binary using the `which` crate
which-rustfmt = ["bindgen/which-rustfmt"]
prettyplease = ["bindgen/prettyplease"]

## The following features are for internal use and they shouldn't be used if
Expand Down
1 change: 0 additions & 1 deletion bindgen-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ owo-colors = "3.5.0"
logging = ["bindgen/logging"]
static = ["bindgen/static"]
runtime = ["bindgen/runtime"]
which-rustfmt = ["bindgen/which-rustfmt"]

__testing_only_extra_assertions = ["bindgen/__testing_only_extra_assertions"]
__testing_only_libclang_9 = ["bindgen/__testing_only_libclang_9"]
Expand Down
7 changes: 3 additions & 4 deletions bindgen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,14 @@ regex = { version = "1.5.3", default-features = false, features = ["std", "unico
rustc-hash = "1.0.1"
shlex = "1"
syn = { version = "2.0", features = ["full", "extra-traits", "visit-mut"] }
which = { version = "4.2.1", optional = true, default-features = false }

[features]
default = ["logging", "prettyplease", "runtime", "which-rustfmt"]
default = ["logging", "prettyplease", "runtime"]
logging = ["dep:log"]
static = ["clang-sys/static"]
runtime = ["clang-sys/runtime"]
# Dynamically discover a `rustfmt` binary using the `which` crate
which-rustfmt = ["dep:which"]
# This feature is no longer used for anything and should be removed in bindgen 0.70
which-rustfmt = []
experimental = ["dep:annotate-snippets"]

## The following features are for internal use and they shouldn't be used if
Expand Down
8 changes: 0 additions & 8 deletions bindgen/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -983,14 +983,6 @@ impl Bindings {
if let Ok(rustfmt) = env::var("RUSTFMT") {
return Ok(Cow::Owned(rustfmt.into()));
}
#[cfg(feature = "which-rustfmt")]
match which::which("rustfmt") {
Ok(p) => Ok(Cow::Owned(p)),
Err(e) => {
Err(io::Error::new(io::ErrorKind::Other, format!("{}", e)))
}
}
#[cfg(not(feature = "which-rustfmt"))]
// No rustfmt binary was specified, so assume that the binary is called
// "rustfmt" and that it is in the user's PATH.
Ok(Cow::Owned("rustfmt".into()))
Expand Down
Loading