Skip to content

Commit

Permalink
docs: enable for protobuf feature (#208)
Browse files Browse the repository at this point in the history
- have docs.rs generate  with `protobuf` feature
- flag that only enabled with `protobuf` feature

Signed-off-by: Max Inden <[email protected]>
  • Loading branch information
mxinden authored Jul 15, 2024
1 parent a914fc9 commit 0f85e8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,8 @@ name = "proto"
path = "benches/encoding/proto.rs"
harness = false
required-features = ["protobuf"]

# 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
1 change: 1 addition & 0 deletions src/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use std::rc::Rc;
use std::sync::Arc;

#[cfg(feature = "protobuf")]
#[cfg_attr(docsrs, doc(cfg(feature = "protobuf")))]
pub mod protobuf;
pub mod text;

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#![deny(unused)]
#![forbid(unsafe_code)]
#![warn(missing_debug_implementations)]
#![cfg_attr(docsrs, feature(doc_cfg))]

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

0 comments on commit 0f85e8e

Please sign in to comment.