diff --git a/protocols/upnp/Cargo.toml b/protocols/upnp/Cargo.toml index 9367f0d6317..8a3c5e0ee90 100644 --- a/protocols/upnp/Cargo.toml +++ b/protocols/upnp/Cargo.toml @@ -25,3 +25,10 @@ tokio = ["igd-next/aio_tokio", "dep:tokio"] [lints] workspace = true + +# Passing arguments to the docsrs builder in order to properly document cfg's. +# More information: https://docs.rs/about/builds#cross-compiling +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] +rustc-args = ["--cfg", "docsrs"] diff --git a/transports/webrtc/Cargo.toml b/transports/webrtc/Cargo.toml index 8a8c928a775..1c5d23b4652 100644 --- a/transports/webrtc/Cargo.toml +++ b/transports/webrtc/Cargo.toml @@ -48,3 +48,10 @@ required-features = ["tokio"] [lints] workspace = true + +# Passing arguments to the docsrs builder in order to properly document cfg's. +# More information: https://docs.rs/about/builds#cross-compiling +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] +rustc-args = ["--cfg", "docsrs"] diff --git a/transports/webrtc/src/lib.rs b/transports/webrtc/src/lib.rs index f71203cc2f7..ea1e6a4d646 100644 --- a/transports/webrtc/src/lib.rs +++ b/transports/webrtc/src/lib.rs @@ -79,5 +79,8 @@ //! hand-crate the SDP answer generated by the remote, this is problematic. A way to solve this //! is to make the hash a part of the remote's multiaddr. On the server side, we turn //! certificate verification off. + +#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] + #[cfg(feature = "tokio")] pub mod tokio;