Skip to content

Commit 3484eb0

Browse files
committed
Implement core::fmt::Display for HumanReadableName
1 parent 97f0e4b commit 3484eb0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lightning/src/onion_message/dns_resolution.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ use dnssec_prover::rr::Name;
3636

3737
use lightning_types::features::NodeFeatures;
3838

39+
use core::fmt;
40+
3941
use crate::blinded_path::message::DNSResolverContext;
4042
use crate::io;
4143
#[cfg(feature = "dnssec")]
@@ -287,6 +289,12 @@ impl Readable for HumanReadableName {
287289
}
288290
}
289291

292+
impl fmt::Display for HumanReadableName {
293+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
294+
write!(f, "₿{}@{}", self.user(), self.domain())
295+
}
296+
}
297+
290298
#[cfg(feature = "dnssec")]
291299
struct PendingResolution {
292300
start_height: u32,

0 commit comments

Comments
 (0)