Skip to content

Commit ac004a9

Browse files
authored
Merge pull request #2187 from benthecarman/invoice-serde-no-std
2 parents e1e3819 + 36f610c commit ac004a9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ci/ci-tests.sh

+5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ for DIR in lightning lightning-invoice lightning-rapid-gossip-sync; do
4242
RUSTFLAGS="--cfg=c_bindings" cargo test --verbose --color always --no-default-features --features=no-std
4343
popd
4444
done
45+
# This one only works for lightning-invoice
46+
pushd lightning-invoice
47+
# check that compile with no-std and serde works in lightning-invoice
48+
cargo test --verbose --color always --no-default-features --features no-std --features serde
49+
popd
4550

4651
echo -e "\n\nTesting no-std build on a downstream no-std crate"
4752
# check no-std compatibility across dependencies

lightning-invoice/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1648,7 +1648,7 @@ impl<'de> Deserialize<'de> for Invoice {
16481648
fn deserialize<D>(deserializer: D) -> Result<Invoice, D::Error> where D: Deserializer<'de> {
16491649
let bolt11 = String::deserialize(deserializer)?
16501650
.parse::<Invoice>()
1651-
.map_err(|e| D::Error::custom(format!("{:?}", e)))?;
1651+
.map_err(|e| D::Error::custom(alloc::format!("{:?}", e)))?;
16521652

16531653
Ok(bolt11)
16541654
}

0 commit comments

Comments
 (0)