Skip to content

Commit

Permalink
Remove which dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai authored and emilio committed Apr 23, 2024
1 parent 9eb512e commit c03964c
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 28 deletions.
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

0 comments on commit c03964c

Please sign in to comment.