Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(iroh): Enable iroh_docsrs feature #2780

Merged
merged 4 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Generate Docs
run: cargo doc --workspace --all-features --no-deps
env:
RUSTDOCFLAGS: --cfg docsrs
RUSTDOCFLAGS: --cfg iroh_docsrs

- name: Deploy Docs to Preview Branch
uses: peaceiris/actions-gh-pages@v4
Expand Down
4 changes: 1 addition & 3 deletions iroh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }

[package.metadata.docs.rs]
all-features = true
# enable unstable features in the documentation
rustdoc-args = ["--cfg", "docsrs"]

rustdoc-args = ["--cfg", "iroh_docsrs"]

[[example]]
name = "hello-world-provide"
Expand Down
4 changes: 2 additions & 2 deletions iroh/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
//! - `metrics`: Enable metrics collection. Enabled by default.
//! - `fs-store`: Enables the disk based storage backend for `iroh-blobs`. Enabled by default.
//!
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(iroh_docsrs, feature(doc_cfg))]
#![deny(missing_docs, rustdoc::broken_intra_doc_links)]

// re-export the iroh crates
Expand All @@ -111,5 +111,5 @@ mod rpc_protocol;

/// Expose metrics module
#[cfg(feature = "metrics")]
#[cfg_attr(all(docsrs, feature = "metrics"), doc(cfg(feature = "metrics")))]
#[cfg_attr(iroh_docsrs, doc(cfg(feature = "metrics")))]
pub mod metrics;
3 changes: 3 additions & 0 deletions iroh/src/node/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ where
node_discovery: DiscoveryConfig,
docs_storage: DocsStorage,
#[cfg(any(test, feature = "test-utils"))]
#[cfg_attr(iroh_docsrs, doc(cfg(any(test, feature = "test-utils"))))]
insecure_skip_relay_cert_verify: bool,
/// Callback to register when a gc loop is done
#[debug("callback")]
Expand Down Expand Up @@ -509,13 +510,15 @@ where
///
/// May only be used in tests.
#[cfg(any(test, feature = "test-utils"))]
#[cfg_attr(iroh_docsrs, doc(cfg(any(test, feature = "test-utils"))))]
pub fn insecure_skip_relay_cert_verify(mut self, skip_verify: bool) -> Self {
self.insecure_skip_relay_cert_verify = skip_verify;
self
}

/// Register a callback for when GC is done.
#[cfg(any(test, feature = "test-utils"))]
#[cfg_attr(iroh_docsrs, doc(cfg(any(test, feature = "test-utils"))))]
pub fn register_gc_done_cb(mut self, cb: Box<dyn Fn() + Send>) -> Self {
self.gc_done_callback.replace(cb);
self
Expand Down
Loading