From b014f0fdcb4cda1d0dd186138e0814befc14e7ee Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Mon, 21 Nov 2022 09:27:16 +1100 Subject: [PATCH 1/2] Fix rustdocs build warnings Building the docs throws a bunch of warnings of form warning: unclosed HTML tag ... Add code ticks to remove the warnings. --- bitcoin/src/amount.rs | 2 +- bitcoin/src/blockdata/witness.rs | 2 +- bitcoin/src/psbt/map/input.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bitcoin/src/amount.rs b/bitcoin/src/amount.rs index 5425da0c..45ef1125 100644 --- a/bitcoin/src/amount.rs +++ b/bitcoin/src/amount.rs @@ -1409,7 +1409,7 @@ pub mod serde { } pub mod opt { - //! Serialize and deserialize [Option] as JSON numbers denominated in BTC. + //! Serialize and deserialize `Option` as JSON numbers denominated in BTC. //! Use with `#[serde(default, with = "amount::serde::as_btc::opt")]`. use serde::{Deserializer, Serializer, de}; diff --git a/bitcoin/src/blockdata/witness.rs b/bitcoin/src/blockdata/witness.rs index 8a416c86..f676e787 100644 --- a/bitcoin/src/blockdata/witness.rs +++ b/bitcoin/src/blockdata/witness.rs @@ -29,7 +29,7 @@ use crate::util::taproot::TAPROOT_ANNEX_PREFIX; /// #[derive(Clone, Default, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] pub struct Witness { - /// Contains the witness Vec> serialization without the initial varint indicating the + /// Contains the witness `Vec>` serialization without the initial varint indicating the /// number of elements (which is stored in `witness_elements`) content: Vec, diff --git a/bitcoin/src/psbt/map/input.rs b/bitcoin/src/psbt/map/input.rs index 25e56f69..42d43a96 100644 --- a/bitcoin/src/psbt/map/input.rs +++ b/bitcoin/src/psbt/map/input.rs @@ -113,7 +113,7 @@ pub struct Input { pub hash256_preimages: BTreeMap>, /// Serialized schnorr signature with sighash type for key spend. pub tap_key_sig: Option, - /// Map of | with signature. + /// Map of `|` with signature. #[cfg_attr(feature = "serde", serde(with = "crate::serde_utils::btreemap_as_seq"))] pub tap_script_sigs: BTreeMap<(XOnlyPublicKey, TapLeafHash), SchnorrSig>, /// Map of Control blocks to Script version pair. From 108a1f73ca8bc14e7b3bed940840b18b2e8b0771 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Mon, 21 Nov 2022 09:28:20 +1100 Subject: [PATCH 2/2] Fail CI if docs build throws warnings Convert all rustdocs build warnings to errors using `-D warnings` and exit the script with 1 to signal the error. While we are at it use `--all-features` instead of explicit feature list when building docs. Without this the docs build fails with: error: too many file operands --- bitcoin/contrib/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitcoin/contrib/test.sh b/bitcoin/contrib/test.sh index e80bd522..68563062 100755 --- a/bitcoin/contrib/test.sh +++ b/bitcoin/contrib/test.sh @@ -81,7 +81,7 @@ cargo run --example taproot-psbt --features=bitcoinconsensus # Build the docs if told to (this only works with the nightly toolchain) if [ "$DO_DOCS" = true ]; then - RUSTDOCFLAGS="--cfg docsrs" cargo +nightly rustdoc --features="$FEATURES" -- -D rustdoc::broken-intra-doc-links + RUSTDOCFLAGS="--cfg docsrs" cargo +nightly rustdoc --all-features -- -D rustdoc::broken-intra-doc-links -D warnings || exit 1 fi # Fuzz if told to