Skip to content

Commit c03964c

Browse files
rukaiemilio
authored andcommitted
Remove which dependency
1 parent 9eb512e commit c03964c

File tree

5 files changed

+4
-28
lines changed

5 files changed

+4
-28
lines changed

Cargo.lock

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-cli/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@ log = { version = "0.4", optional = true }
2828
shlex = "1"
2929

3030
[features]
31-
default = ["logging", "runtime", "which-rustfmt"]
31+
default = ["logging", "runtime"]
3232
logging = ["bindgen/logging", "dep:env_logger", "dep:log"]
3333
static = ["bindgen/static"]
3434
runtime = ["bindgen/runtime"]
35-
# Dynamically discover a `rustfmt` binary using the `which` crate
36-
which-rustfmt = ["bindgen/which-rustfmt"]
3735
prettyplease = ["bindgen/prettyplease"]
3836

3937
## The following features are for internal use and they shouldn't be used if

bindgen-tests/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ owo-colors = "3.5.0"
1919
logging = ["bindgen/logging"]
2020
static = ["bindgen/static"]
2121
runtime = ["bindgen/runtime"]
22-
which-rustfmt = ["bindgen/which-rustfmt"]
2322

2423
__testing_only_extra_assertions = ["bindgen/__testing_only_extra_assertions"]
2524
__testing_only_libclang_9 = ["bindgen/__testing_only_libclang_9"]

bindgen/Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,14 @@ regex = { version = "1.5.3", default-features = false, features = ["std", "unico
4040
rustc-hash = "1.0.1"
4141
shlex = "1"
4242
syn = { version = "2.0", features = ["full", "extra-traits", "visit-mut"] }
43-
which = { version = "4.2.1", optional = true, default-features = false }
4443

4544
[features]
46-
default = ["logging", "prettyplease", "runtime", "which-rustfmt"]
45+
default = ["logging", "prettyplease", "runtime"]
4746
logging = ["dep:log"]
4847
static = ["clang-sys/static"]
4948
runtime = ["clang-sys/runtime"]
50-
# Dynamically discover a `rustfmt` binary using the `which` crate
51-
which-rustfmt = ["dep:which"]
49+
# This feature is no longer used for anything and should be removed in bindgen 0.70
50+
which-rustfmt = []
5251
experimental = ["dep:annotate-snippets"]
5352

5453
## The following features are for internal use and they shouldn't be used if

bindgen/lib.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -983,14 +983,6 @@ impl Bindings {
983983
if let Ok(rustfmt) = env::var("RUSTFMT") {
984984
return Ok(Cow::Owned(rustfmt.into()));
985985
}
986-
#[cfg(feature = "which-rustfmt")]
987-
match which::which("rustfmt") {
988-
Ok(p) => Ok(Cow::Owned(p)),
989-
Err(e) => {
990-
Err(io::Error::new(io::ErrorKind::Other, format!("{}", e)))
991-
}
992-
}
993-
#[cfg(not(feature = "which-rustfmt"))]
994986
// No rustfmt binary was specified, so assume that the binary is called
995987
// "rustfmt" and that it is in the user's PATH.
996988
Ok(Cow::Owned("rustfmt".into()))

0 commit comments

Comments
 (0)