Skip to content

Commit 0f85e8e

Browse files
authored
docs: enable for protobuf feature (#208)
- have docs.rs generate with `protobuf` feature - flag that only enabled with `protobuf` feature Signed-off-by: Max Inden <[email protected]>
1 parent a914fc9 commit 0f85e8e

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,8 @@ name = "proto"
6161
path = "benches/encoding/proto.rs"
6262
harness = false
6363
required-features = ["protobuf"]
64+
65+
# Passing arguments to the docsrs builder in order to properly document cfg's.
66+
# More information: https://docs.rs/about/builds#cross-compiling
67+
[package.metadata.docs.rs]
68+
all-features = true

src/encoding.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use std::rc::Rc;
1313
use std::sync::Arc;
1414

1515
#[cfg(feature = "protobuf")]
16+
#[cfg_attr(docsrs, doc(cfg(feature = "protobuf")))]
1617
pub mod protobuf;
1718
pub mod text;
1819

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#![deny(unused)]
44
#![forbid(unsafe_code)]
55
#![warn(missing_debug_implementations)]
6+
#![cfg_attr(docsrs, feature(doc_cfg))]
67

78
//! Client library implementation of the [Open Metrics
89
//! specification](https://github.com/OpenObservability/OpenMetrics). Allows

0 commit comments

Comments
 (0)