diff --git a/libdisplay-info-sys/Cargo.toml b/libdisplay-info-sys/Cargo.toml index 24e9b91..cafd164 100644 --- a/libdisplay-info-sys/Cargo.toml +++ b/libdisplay-info-sys/Cargo.toml @@ -4,14 +4,16 @@ categories = ["api-bindings"] description = "Low-level bindings for libdisplay-info." documentation = "https://docs.rs/libdisplay-info-sys/" edition = "2021" -version = "0.2.1" +version = "0.2.2" keywords = ["libdisplay", "DisplayID", "EDID"] license = "MIT" name = "libdisplay-info-sys" repository = "https://github.com/Smithay/libdisplay-info-rs" readme = "README.md" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[package.metadata.docs.rs] +features = ["v0_2"] +rustdoc-args = ["--cfg", "docsrs"] [features] v0_2 = [] diff --git a/libdisplay-info-sys/build.rs b/libdisplay-info-sys/build.rs index 1234ee7..d333af2 100644 --- a/libdisplay-info-sys/build.rs +++ b/libdisplay-info-sys/build.rs @@ -1,8 +1,6 @@ fn main() { if std::env::var("DOCS_RS").is_ok() { - // don't link against unavailable native lib in doc.rs builds and - // just assume the highest version is available - println!("cargo:rustc-cfg=feature=\"v0_2\""); + // don't link against unavailable native lib in doc.rs builds return; } diff --git a/libdisplay-info-sys/src/lib.rs b/libdisplay-info-sys/src/lib.rs index dab4c62..0a0fdb1 100644 --- a/libdisplay-info-sys/src/lib.rs +++ b/libdisplay-info-sys/src/lib.rs @@ -1,3 +1,4 @@ +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] diff --git a/libdisplay-info/Cargo.toml b/libdisplay-info/Cargo.toml index 72dced8..16578ea 100644 --- a/libdisplay-info/Cargo.toml +++ b/libdisplay-info/Cargo.toml @@ -4,20 +4,22 @@ categories = ["api-bindings"] description = "EDID and DisplayID library." documentation = "https://docs.rs/libdisplay-info/" edition = "2021" -version = "0.2.1" +version = "0.2.2" keywords = ["libdisplay", "DisplayID", "EDID"] license = "MIT" name = "libdisplay-info" repository = "https://github.com/Smithay/libdisplay-info-rs" readme = "../README.md" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[package.metadata.docs.rs] +features = ["v0_2"] +rustdoc-args = ["--cfg", "docsrs"] [features] v0_2 = ["libdisplay-info-sys/v0_2"] [dependencies] -libdisplay-info-sys = { version = "0.2.1", path = "../libdisplay-info-sys" } +libdisplay-info-sys = { version = "0.2.2", path = "../libdisplay-info-sys" } libc = "0.2.155" thiserror = "2.0.9" libdisplay-info-derive = { version = "0.1.0", path = "../libdisplay-info-derive" } diff --git a/libdisplay-info/src/lib.rs b/libdisplay-info/src/lib.rs index cb79f9f..a49d79e 100644 --- a/libdisplay-info/src/lib.rs +++ b/libdisplay-info/src/lib.rs @@ -1,3 +1,5 @@ +#![cfg_attr(docsrs, feature(doc_auto_cfg))] + use std::{ ffi::{c_char, CStr}, marker::PhantomData,