Skip to content

Commit d0eaadf

Browse files
committed
Merge #2099: Fix no-std compilation
546b07e chore(example_cli,esplora): Fix no-std compilation (志宇) Pull request description: ### Description `serde_json` requires either `std` or `alloc` feature enabled. We just enable `alloc` as we don't need the features that `std` provides. ### Notes to the reviewers `alloc` is just a subset of `std`. `json_serde` has `from_reader()` & `to_writer()` methods if `std` is enabled. We aren't using those methods so just having `alloc` is fine. I'm also not sure why an explicit `alloc` cargo feature flag is needed in `serde_json`. They can just have an internal prelude based on whether the `std` feature is enabled. ### Checklists #### All Submissions: * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) ACKs for top commit: luisschwab: ACK 546b07e oleonardolima: ACK 546b07e Tree-SHA512: 05afc4d7ee3c1c7de8f2cd497a6a02f7bc4f1410e83604627c8af2b1a36fb92cd2fbe774a8d63bf2c4cffc8d4ddcc009adfdaeb59cdca3201f128f34639f39c2
2 parents 226b65c + 546b07e commit d0eaadf

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

crates/esplora/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ bdk_core = { path = "../core", version = "0.6.1", default-features = false }
2020
esplora-client = { version = "0.12.1", default-features = false }
2121
async-trait = { version = "0.1.66", optional = true }
2222
futures = { version = "0.3.26", optional = true }
23+
serde_json = { version = "1.0", features = ["alloc"] }
2324

2425
[dev-dependencies]
2526
esplora-client = { version = "0.12.0" }

examples/example_cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ anyhow = "1"
1515
clap = { version = "4.5.17", features = ["derive", "env"] }
1616
rand = "0.8"
1717
serde = { version = "1", features = ["derive"] }
18-
serde_json = "1.0"
18+
serde_json = { version = "1.0", features = ["alloc"] }

0 commit comments

Comments
 (0)