Skip to content

Commit 0f2d6a4

Browse files
committed
Show metrics feature requirement in docs.rs
1 parent 8bf77f2 commit 0f2d6a4

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ exclude = [
1818
"README.tpl",
1919
]
2020

21+
[package.metadata.docs.rs]
22+
all-features = true
23+
rustdoc-args = ["--cfg", "docsrs"]
24+
2125
[features]
2226
reqwest-blocking-client = ["reqwest-client"]
2327
reqwest-blocking-client-rustls = ["reqwest-client-rustls"]
@@ -53,9 +57,6 @@ test-case = "1.1.0"
5357
tokio = { version = "1.7.0", features = ["rt", "macros", "process", "time"] }
5458
version-sync = "0.9.2"
5559

56-
[package.metadata.docs.rs]
57-
all-features = true
58-
5960
[badges]
6061
github = { repository = "frigus02/opentelemetry-application-insights", workflow = "CI" }
6162

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@
206206
//! [`Selector`]: https://docs.rs/opentelemetry/0.16.0/opentelemetry/sdk/metrics/selectors/simple/enum.Selector.html
207207
#![doc(html_root_url = "https://docs.rs/opentelemetry-application-insights/0.17.0")]
208208
#![deny(missing_docs, unreachable_pub, missing_debug_implementations)]
209+
#![cfg_attr(docsrs, feature(doc_cfg))]
209210
#![cfg_attr(test, deny(warnings))]
210211

211212
mod convert;

src/metrics.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use opentelemetry::{
1919
};
2020
use std::convert::{TryFrom, TryInto};
2121

22+
#[cfg_attr(docsrs, doc(cfg(feature = "metrics")))]
2223
impl<C> ExportKindFor for Exporter<C>
2324
where
2425
C: std::fmt::Debug,
@@ -28,6 +29,7 @@ where
2829
}
2930
}
3031

32+
#[cfg_attr(docsrs, doc(cfg(feature = "metrics")))]
3133
impl<C> MetricsExporter for Exporter<C>
3234
where
3335
C: std::fmt::Debug,

0 commit comments

Comments
 (0)