]> Untitled Git - bdk/commitdiff
Fix: Run README.md example on the CI
authormeryacine <omar.groza@gmail.com>
Fri, 8 Jul 2022 13:08:22 +0000 (15:08 +0200)
committermeryacine <omar.groza@gmail.com>
Sun, 17 Jul 2022 16:33:56 +0000 (18:33 +0200)
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
src/doctest.rs

index a8b28cd180c99a119d902cd1904b64e5eadf6f17..1bfa1b6c8ecd0fa812d9c7c57af8689c3e4e5f22 100644 (file)
--- 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
 ```
 
index 7733341a49e9bc1416e5887e242b1f545cfd283a..6c1f772c248e82991679f04063f787cb2ae80aaf 100644 (file)
@@ -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;