Skip to content

Commit c4b53d5

Browse files
committed
Move UniFFI-specific re-exports to uniffi_types.rs
.. which declutters our `lib.rs` imports a bit.
1 parent 06bd82d commit c4b53d5

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

src/lib.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,7 @@ pub use types::ChannelConfig;
108108
pub use io::utils::generate_entropy_mnemonic;
109109

110110
#[cfg(feature = "uniffi")]
111-
use {
112-
bip39::Mnemonic,
113-
bitcoin::OutPoint,
114-
lightning::events::{ClosureReason, PaymentFailureReason},
115-
lightning::ln::ChannelId,
116-
lightning::ln::PaymentSecret,
117-
lightning::util::string::UntrustedString,
118-
uniffi_types::*,
119-
};
111+
use uniffi_types::*;
120112

121113
#[cfg(feature = "uniffi")]
122114
pub use builder::ArcedNodeBuilder as Builder;

src/uniffi_types.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
pub use lightning::events::{ClosureReason, PaymentFailureReason};
2+
pub use lightning::ln::ChannelId;
3+
pub use lightning::ln::PaymentSecret;
4+
pub use lightning::util::string::UntrustedString;
5+
6+
pub use bitcoin::OutPoint;
7+
8+
pub use bip39::Mnemonic;
9+
110
use crate::UniffiCustomTypeConverter;
211

312
use crate::error::Error;
@@ -9,12 +18,9 @@ use bitcoin::hashes::sha256::Hash as Sha256;
918
use bitcoin::hashes::Hash;
1019
use bitcoin::secp256k1::PublicKey;
1120
use bitcoin::{Address, Txid};
12-
use lightning::ln::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
13-
use lightning::util::string::UntrustedString;
21+
use lightning::ln::{PaymentHash, PaymentPreimage};
1422
use lightning_invoice::{Bolt11Invoice, SignedRawBolt11Invoice};
1523

16-
use bip39::Mnemonic;
17-
1824
use std::convert::TryInto;
1925
use std::str::FromStr;
2026

0 commit comments

Comments
 (0)