From c99dc15cf9c412505bb7b7c921b539962cb9a596 Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Thu, 22 Feb 2024 13:46:42 +0100 Subject: [PATCH] Move UniFFI-specific re-exports to `uniffi_types.rs` .. which declutters our `lib.rs` imports a bit. --- src/lib.rs | 10 +--------- src/uniffi_types.rs | 14 ++++++++++---- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b90f9ab20..555648beb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -108,15 +108,7 @@ pub use types::ChannelConfig; pub use io::utils::generate_entropy_mnemonic; #[cfg(feature = "uniffi")] -use { - bip39::Mnemonic, - bitcoin::OutPoint, - lightning::events::{ClosureReason, PaymentFailureReason}, - lightning::ln::ChannelId, - lightning::ln::PaymentSecret, - lightning::util::string::UntrustedString, - uniffi_types::*, -}; +use uniffi_types::*; #[cfg(feature = "uniffi")] pub use builder::ArcedNodeBuilder as Builder; diff --git a/src/uniffi_types.rs b/src/uniffi_types.rs index 9c0ad0cd0..baedd0aa6 100644 --- a/src/uniffi_types.rs +++ b/src/uniffi_types.rs @@ -1,3 +1,12 @@ +pub use lightning::events::{ClosureReason, PaymentFailureReason}; +pub use lightning::ln::ChannelId; +pub use lightning::ln::PaymentSecret; +pub use lightning::util::string::UntrustedString; + +pub use bitcoin::OutPoint; + +pub use bip39::Mnemonic; + use crate::UniffiCustomTypeConverter; use crate::error::Error; @@ -9,12 +18,9 @@ use bitcoin::hashes::sha256::Hash as Sha256; use bitcoin::hashes::Hash; use bitcoin::secp256k1::PublicKey; use bitcoin::{Address, Txid}; -use lightning::ln::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret}; -use lightning::util::string::UntrustedString; +use lightning::ln::{PaymentHash, PaymentPreimage}; use lightning_invoice::{Bolt11Invoice, SignedRawBolt11Invoice}; -use bip39::Mnemonic; - use std::convert::TryInto; use std::str::FromStr;