diff --git a/Cargo.toml b/Cargo.toml index 2c1abd1..afa64bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,8 +11,8 @@ description = "Rust bindings to the System Informer's (formerly known as Process # exclude = ["deps"] [features] +default = ["docsrs"] docsrs = [] -default = [] [package.metadata.docs.rs] features = ["docsrs"] diff --git a/src/build.rs b/src/build.rs index e59ab35..5509ac0 100644 --- a/src/build.rs +++ b/src/build.rs @@ -111,7 +111,7 @@ impl BindgenConfig { fn main() { if cfg!(feature = "docsrs") { - println!("Skipping regeneration of bindings for docs."); + println!("Skipping regeneration of bindings for docs.rs."); return; } diff --git a/src/lib.rs b/src/lib.rs index 9ed78a3..55da5f7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,8 +5,11 @@ non_camel_case_types, non_upper_case_globals )] -#[cfg(not(feature="docsrs"))] pub mod ffi { + // use vendored `generated.rs` for docs.rs + #[cfg(feature="docsrs")] + include!("ffi/generated.rs"); + #[cfg(not(feature="docsrs"))] include!(concat!(env!("OUT_DIR"), "\\generated.rs"));