From 9d2024434eb0d542133d06db14020968e713fd9b Mon Sep 17 00:00:00 2001 From: meryacine Date: Fri, 8 Jul 2022 15:08:22 +0200 Subject: [PATCH] Fix: Run README.md example on the CI Seems like `doc(include = "../README.md")` doesn't include the readme file as docs for the dummy struct. This might be due to a difference in Rust edition used back then or something --- README.md | 6 ++++-- src/doctest.rs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a8b28cd1..1bfa1b6c 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ use bdk::blockchain::ElectrumBlockchain; use bdk::electrum_client::Client; use bdk::wallet::AddressIndex::New; +use bitcoin::base64; use bitcoin::consensus::serialize; fn main() -> Result<(), bdk::Error> { @@ -131,6 +132,7 @@ fn main() -> Result<(), bdk::Error> { ```rust,no_run use bdk::{Wallet, SignOptions, database::MemoryDatabase}; +use bitcoin::base64; use bitcoin::consensus::deserialize; fn main() -> Result<(), bdk::Error> { @@ -154,7 +156,7 @@ fn main() -> Result<(), bdk::Error> { ### Unit testing -``` +```bash cargo test ``` @@ -162,7 +164,7 @@ cargo test Integration testing require testing features, for example: -``` +```bash cargo test --features test-electrum ``` diff --git a/src/doctest.rs b/src/doctest.rs index 7733341a..6c1f772c 100644 --- a/src/doctest.rs +++ b/src/doctest.rs @@ -9,6 +9,6 @@ // You may not use this file except in accordance with one or both of these // licenses. -#[doc(include = "../README.md")] +#[doc = include_str!("../README.md")] #[cfg(doctest)] pub struct ReadmeDoctests;