Skip to content

Commit f9df07a

Browse files
committed
Don't make references to std in lightning-invoice in bindings
As we support `no-std` for `lightning-invoice` builds, we should support them in `c_bindings` as well, which we add a test for in CI here.
1 parent 3b7859f commit f9df07a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ jobs:
127127
cargo test --verbose --color always --no-default-features --features no-std
128128
# check if there is a conflict between no-std and the default std feature
129129
cargo test --verbose --color always --features no-std
130+
# check if there is a conflict between no-std and the c_bindings cfg
131+
RUSTFLAGS="--cfg=c_bindings" cargo test --verbose --color always --no-default-features --features=no-std
130132
# check no-std compatibility across dependencies
131133
cd ..
132134
cd no-std-check

lightning-invoice/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ impl<'a, S: Score> ScorerAccountingForInFlightHtlcs<'a, S> {
559559

560560
#[cfg(c_bindings)]
561561
impl<'a, S:Score> lightning::util::ser::Writeable for ScorerAccountingForInFlightHtlcs<'a, S> {
562-
fn write<W: lightning::util::ser::Writer>(&self, writer: &mut W) -> Result<(), std::io::Error> { self.scorer.write(writer) }
562+
fn write<W: lightning::util::ser::Writer>(&self, writer: &mut W) -> Result<(), lightning::io::Error> { self.scorer.write(writer) }
563563
}
564564

565565
impl<'a, S: Score> Score for ScorerAccountingForInFlightHtlcs<'a, S> {

0 commit comments

Comments
 (0)