From 3458950bea7d28b822c301ed3015880904bdf020 Mon Sep 17 00:00:00 2001 From: Hannes <55623006+umgefahren@users.noreply.github.com> Date: Mon, 9 Oct 2023 04:46:32 +0200 Subject: [PATCH] chore(upnp, webrtc): add missing docs.rs metadata Includes necessary package metadata to improve documentation on docs.rs (shows which items are behind a cfg). Read more on: #2983 Pull-Request: #4599. --- protocols/upnp/Cargo.toml | 7 +++++++ transports/webrtc/Cargo.toml | 7 +++++++ transports/webrtc/src/lib.rs | 3 +++ 3 files changed, 17 insertions(+) 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;