Skip to content

Commit 7bc52aa

Browse files
Merge pull request #1740 from TheBlueMatt/2022-09-invoice-bindings-nostd
Don't make references to `std` in `lightning-invoice` in bindings
2 parents ed7e30e + 54fa628 commit 7bc52aa

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

.github/workflows/build.yml

+2
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/payment.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,7 @@ mod tests {
19131913

19141914
#[cfg(c_bindings)]
19151915
impl lightning::util::ser::Writeable for TestScorer {
1916-
fn write<W: lightning::util::ser::Writer>(&self, _: &mut W) -> Result<(), std::io::Error> { unreachable!(); }
1916+
fn write<W: lightning::util::ser::Writer>(&self, _: &mut W) -> Result<(), lightning::io::Error> { unreachable!(); }
19171917
}
19181918

19191919
impl Score for TestScorer {

lightning-invoice/src/utils.rs

+1-1
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)