Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
regtest: Attempt to fix Client docs
Browse files Browse the repository at this point in the history
The crate is not typical in that it expects at least one of the "verison
number" features to be enabled. This does not play nicely with the
docs.rs build. In an effort to make things at least uderstandable add do
a few things:

- inline the `Client` and `json` docs
- configure docs.rs build to enable 26_0
- Add a big fat note to hopefully alleviate the misleading
  "Available on crate feature 26_0 only."
  • Loading branch information
tcharding committed Jun 17, 2024
1 parent 9093e58 commit 8409622
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion regtest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ anyhow = "1.0.66"


[package.metadata.docs.rs]
features = ["download", "doc"]
features = ["download", "doc", "26_0"]
rustdoc-args = ["--cfg", "docsrs"]

[patch.crates-io.bitcoind-json-rpc-client]
Expand Down
8 changes: 7 additions & 1 deletion regtest/src/client_versions.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
// All features uses 26_0
/// The version specific client and json types.
///
/// **THIS IS AVAILABLE FOR ALL VERSION NUMBER FEATURES** (eg `25_0`, `24_2` etc). This crate is
/// unusual in that it expects exactly one version number feature to be selected, docs.rs is not set
/// up to handle such oddity.
///
#[cfg(feature = "26_0")]
#[allow(unused_imports)] // Not all users need the json types.
pub use bitcoind_json_rpc_client::{client_sync::v26::{Client, AddressType}, json::v26 as json};
Expand Down Expand Up @@ -67,7 +73,7 @@ pub use bitcoind_json_rpc_client::{client_sync::v18::{Client, AddressType}, json
#[allow(unused_imports)] // Not all users need the json types.
pub use bitcoind_json_rpc_client::{client_sync::v17::{Client, AddressType}, json::v17 as json};

// To make --no-default-features work we have to enable some feature, use most recent version same as for default.
// To make --no-default-features work we have to re-export a the types, use most recent version same as we do for all features.
#[cfg(all(not(feature = "26_0"), not(feature = "25_2"), not(feature = "25_1"), not(feature = "25_0"), not(feature = "24_2"),not(feature = "24_1"), not(feature = "24_0_1"), not(feature = "23_2"), not(feature = "23_1"), not(feature = "23_0"), not(feature = "22_1"), not(feature = "22_0"), not(feature = "0_21_2"), not(feature = "0_20_2"), not(feature = "0_19_1"), not(feature = "0_18_1"), not(feature = "0_17_1")))]
#[allow(unused_imports)] // Not all users need the json types.
pub use bitcoind_json_rpc_client::{client_sync::v26::{Client, AddressType}, json::v26 as json};
1 change: 1 addition & 0 deletions regtest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use tempfile::TempDir;
pub use {anyhow, tempfile, which};

#[rustfmt::skip] // Keep pubic re-exports separate.
#[doc(inline)]
pub use self::{
client_versions::{json, Client, AddressType},
versions::VERSION,
Expand Down

0 comments on commit 8409622

Please sign in to comment.