diff --git a/Cargo.lock b/Cargo.lock index 6d42af9..e07e4de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -297,7 +297,7 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "phnt" -version = "0.0.16" +version = "0.0.17" dependencies = [ "bindgen", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 70f5574..4f04bc1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,10 +15,9 @@ default = [] docsrs = [] [package.metadata.docs.rs] -features = ["docsrs"] -all-features = true default-target = "x86_64-pc-windows-msvc" -targets = [] +targets = ["x86_64-pc-windows-msvc"] +rustdoc-args = ["--cfg", "docsrs"] [build-dependencies] windows.features = ["Win32_Foundation"] diff --git a/src/build.rs b/src/build.rs index 5509ac0..cf100f6 100644 --- a/src/build.rs +++ b/src/build.rs @@ -110,7 +110,7 @@ impl BindgenConfig { } fn main() { - if cfg!(feature = "docsrs") { + if cfg!(docsrs) { println!("Skipping regeneration of bindings for docs.rs."); return; } diff --git a/src/lib.rs b/src/lib.rs index a11efda..58356ec 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,11 +32,11 @@ /// Bindings for `phnt` (nightly) generated by `bindgen` pub mod ffi { // use vendored `generated.rs` for docs.rs - #[cfg(feature = "docsrs")] + #[cfg(docsrs)] include!("ffi/generated.rs"); // use regenerated bindings in production - #[cfg(not(feature = "docsrs"))] + #[cfg(not(docsrs))] include!(concat!(env!("OUT_DIR"), "\\generated.rs")); }