Skip to content

Commit 1cda935

Browse files
authored
RUST-408 Generate API documentation for the sync API on docs.rs (#173)
1 parent 94ad1e7 commit 1cda935

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,6 @@ function_name = "0.2.0"
8282
pretty_assertions = "0.6.1"
8383
serde_json = "1.0.40"
8484
semver = "0.9.0"
85+
86+
[package.metadata.docs.rs]
87+
rustdoc-args = ["--cfg", "docsrs"]

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
clippy::float_cmp
7878
)
7979
)]
80+
#![cfg_attr(docsrs, feature(doc_cfg))]
8081

8182
macro_rules! define_if_single_runtime_enabled {
8283
( $( $def:item )+ ) => {
@@ -113,7 +114,8 @@ define_if_single_runtime_enabled! {
113114
mod sdam;
114115
mod selection_criteria;
115116
mod srv;
116-
#[cfg(feature = "sync")]
117+
#[cfg(any(feature = "sync", docsrs))]
118+
#[cfg_attr(docsrs, doc(cfg(feature = "sync")))]
117119
pub mod sync;
118120
#[cfg(test)]
119121
mod test;

src/sync/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Contains the sync API. This is only available when the `sync` feature is enabled.
2+
13
mod client;
24
mod coll;
35
mod cursor;

0 commit comments

Comments
 (0)