Skip to content

Commit 900d508

Browse files
committed
Merge #129: doc: fix cargo doc builds when non-default features selected
6eece87 doc: fix cargo doc builds when non-default features selected (Philip Kannegaard Hayes) Pull request description: While upgrading to `v0.12.0` our `cargo doc` builds broke: ```bash $ cargo doc --no-default-features --features=async,tokio # ... error: unresolved link to `minreq` --> /Users/phlip9/dev/esplora-client/src/lib.rs:54:42 | 54 | //! * `blocking-https-bundled` enables [`minreq`], the blocking client with proxy and TLS (SSL) | ^^^^^^ no item named `minreq` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` error: public documentation for `max_retries` links to private item `RETRYABLE_ERROR_CODES` --> /Users/phlip9/dev/esplora-client/src/lib.rs:171:21 | 171 | /// is one of [`RETRYABLE_ERROR_CODES`]. | ^^^^^^^^^^^^^^^^^^^^^ this item is private # ... etc ``` To keep the nice doc links to `minreq` and `reqwest`, I just pointed them to <https://docs.rs/minreq> and <https://docs.rs/reqwest> respectively. It won't resolve to the exact version, but it's better than nothing IMO. ACKs for top commit: notmandatory: ACK 6eece87 Tree-SHA512: fafe24422f41c0360f2138af0ea133c98bf88fcd5b4012a1cf336af51cfb309cfc3f867ce3c061e03519560ac2e90fe20d3b50accaf1bbbfafdfd966c12f1e21
2 parents 030f823 + 6eece87 commit 900d508

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@
6363
//! * `async-https-rustls-manual-roots` enables [`reqwest`], the async client with support for
6464
//! proxying and TLS (SSL) using the `rustls` TLS backend without using its the default root
6565
//! certificates.
66-
66+
//!
67+
//! [`dont remove this line or cargo doc will break`]: https://example.com
68+
#![cfg_attr(not(feature = "minreq"), doc = "[`minreq`]: https://docs.rs/minreq")]
69+
#![cfg_attr(not(feature = "reqwest"), doc = "[`reqwest`]: https://docs.rs/reqwest")]
6770
#![allow(clippy::result_large_err)]
6871

6972
use std::collections::HashMap;
@@ -87,7 +90,7 @@ pub use blocking::BlockingClient;
8790
pub use r#async::AsyncClient;
8891

8992
/// Response status codes for which the request may be retried.
90-
const RETRYABLE_ERROR_CODES: [u16; 3] = [
93+
pub const RETRYABLE_ERROR_CODES: [u16; 3] = [
9194
429, // TOO_MANY_REQUESTS
9295
500, // INTERNAL_SERVER_ERROR
9396
503, // SERVICE_UNAVAILABLE

0 commit comments

Comments
 (0)