Skip to content

Commit a9a6989

Browse files
fix(docs): remove nightly doc_cfg feature so docs.rs builds on stable
`#[doc(cfg(...))]` and `#![feature(doc_cfg)]` are nightly-only, so docs.rs (stable Rust) was crashing on the docs build and rendering an empty page. The `rustdoc-args = ["--cfg", "docsrs", ...]` line in Cargo.toml made things worse by injecting `--cfg docsrs`, which activated the nightly feature gate. Drop the nightly feature gate, the explicit `--cfg docsrs` injection (docs.rs sets it itself), and the `#[cfg_attr(docsrs, doc(cfg(...)))]` annotations. Feature-gated modules and methods retain their `#[cfg(feature = "...")]` compilation gates; only the per-item "Available on feature X" badge is lost, which docs.rs surfaces via its sidebar Feature flags panel anyway. Verified with `RUSTDOCFLAGS="--cfg docsrs -D warnings" cargo doc --all-features` (clean) plus the full build/test/clippy/publish-dry-run gate.
1 parent 333d84d commit a9a6989

3 files changed

Lines changed: 1 addition & 12 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,4 @@ serde_json = "1"
5555
proptest = "1"
5656

5757
[package.metadata.docs.rs]
58-
all-features = true
59-
rustdoc-args = ["--cfg", "docsrs", "-D", "warnings"]
58+
all-features = true

src/client.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,31 +76,27 @@ impl Bkash {
7676

7777
/// Access the Tokenized Checkout product accessor.
7878
#[cfg(feature = "tokenized-checkout")]
79-
#[cfg_attr(docsrs, doc(cfg(feature = "tokenized-checkout")))]
8079
#[must_use]
8180
pub fn tokenized(&self) -> crate::tokenized::TokenizedCheckoutClient<'_> {
8281
crate::tokenized::TokenizedCheckoutClient::new(self)
8382
}
8483

8584
/// Access the URL-based Checkout product accessor.
8685
#[cfg(feature = "checkout")]
87-
#[cfg_attr(docsrs, doc(cfg(feature = "checkout")))]
8886
#[must_use]
8987
pub fn checkout(&self) -> crate::checkout::CheckoutClient<'_> {
9088
crate::checkout::CheckoutClient::new(self)
9189
}
9290

9391
/// Access the Auth & Capture product accessor.
9492
#[cfg(feature = "auth-capture")]
95-
#[cfg_attr(docsrs, doc(cfg(feature = "auth-capture")))]
9693
#[must_use]
9794
pub fn auth_capture(&self) -> crate::auth_capture::AuthCaptureClient<'_> {
9895
crate::auth_capture::AuthCaptureClient::new(self)
9996
}
10097

10198
/// Access the Subscriptions product accessor.
10299
#[cfg(feature = "subscriptions")]
103-
#[cfg_attr(docsrs, doc(cfg(feature = "subscriptions")))]
104100
#[must_use]
105101
pub fn subscriptions(&self) -> crate::subscriptions::SubscriptionsClient<'_> {
106102
crate::subscriptions::SubscriptionsClient::new(self)

src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,23 @@
3636
3737
#![deny(missing_docs)]
3838
#![warn(rust_2018_idioms)]
39-
#![cfg_attr(docsrs, feature(doc_cfg))]
4039

4140
#[cfg(feature = "auth-capture")]
42-
#[cfg_attr(docsrs, doc(cfg(feature = "auth-capture")))]
4341
pub mod auth_capture;
4442
#[cfg(feature = "checkout")]
45-
#[cfg_attr(docsrs, doc(cfg(feature = "checkout")))]
4643
pub mod checkout;
4744
pub mod client;
4845
pub mod config;
4946
pub mod error;
5047
pub mod models;
5148
pub mod prelude;
5249
#[cfg(feature = "subscriptions")]
53-
#[cfg_attr(docsrs, doc(cfg(feature = "subscriptions")))]
5450
pub mod subscriptions;
5551
pub mod token;
5652
#[cfg(feature = "tokenized-checkout")]
57-
#[cfg_attr(docsrs, doc(cfg(feature = "tokenized-checkout")))]
5853
pub mod tokenized;
5954
pub mod transport;
6055
#[cfg(feature = "webhooks")]
61-
#[cfg_attr(docsrs, doc(cfg(feature = "webhooks")))]
6256
pub mod webhooks;
6357

6458
pub use crate::client::Bkash;

0 commit comments

Comments
 (0)