mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-24 15:02:20 +01:00
rustfmt
: Run on lightning-invoice/src/ser.rs
This commit is contained in:
parent
323571db90
commit
1fcd36385f
1 changed files with 16 additions and 16 deletions
|
@ -1,13 +1,17 @@
|
|||
use alloc::boxed::Box;
|
||||
use core::fmt;
|
||||
use core::fmt::{Display, Formatter};
|
||||
use core::{array, iter};
|
||||
use alloc::boxed::Box;
|
||||
|
||||
use bech32::{ByteIterExt, Fe32, Fe32IterExt};
|
||||
use crate::prelude::*;
|
||||
use bech32::{ByteIterExt, Fe32, Fe32IterExt};
|
||||
|
||||
use super::{Bolt11Invoice, Bolt11InvoiceFeatures, Sha256, TaggedField, ExpiryTime, MinFinalCltvExpiryDelta, Fallback, PayeePubKey, Bolt11InvoiceSignature, PaymentSecret, PositiveTimestamp,
|
||||
PrivateRoute, Description, RawTaggedField, Currency, RawHrp, SiPrefix, constants, SignedRawBolt11Invoice, RawDataPart, RouteHintHop};
|
||||
use super::{
|
||||
constants, Bolt11Invoice, Bolt11InvoiceFeatures, Bolt11InvoiceSignature, Currency, Description,
|
||||
ExpiryTime, Fallback, MinFinalCltvExpiryDelta, PayeePubKey, PaymentSecret, PositiveTimestamp,
|
||||
PrivateRoute, RawDataPart, RawHrp, RawTaggedField, RouteHintHop, Sha256, SiPrefix,
|
||||
SignedRawBolt11Invoice, TaggedField,
|
||||
};
|
||||
|
||||
/// Objects that can be encoded to base32 (bech32).
|
||||
///
|
||||
|
@ -181,13 +185,7 @@ impl Display for RawHrp {
|
|||
None => String::new(),
|
||||
};
|
||||
|
||||
write!(
|
||||
f,
|
||||
"ln{}{}{}",
|
||||
self.currency,
|
||||
amount,
|
||||
si_prefix
|
||||
)
|
||||
write!(f, "ln{}{}{}", self.currency, amount, si_prefix)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -206,7 +204,9 @@ impl Display for Currency {
|
|||
|
||||
impl Display for SiPrefix {
|
||||
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
||||
write!(f, "{}",
|
||||
write!(
|
||||
f,
|
||||
"{}",
|
||||
match *self {
|
||||
SiPrefix::Milli => "m",
|
||||
SiPrefix::Micro => "u",
|
||||
|
|
Loading…
Add table
Reference in a new issue