Skip to content

Commit e839712

Browse files
committed
Avoid use std and use std::fmt and fmt:: instead in network_graph
1 parent 586dfea commit e839712

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

lightning/src/routing/network_graph.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ use ln::msgs;
1616
use util::ser::{Writeable, Readable, Writer};
1717
use util::logger::Logger;
1818

19-
use std::cmp;
19+
use std::{cmp, fmt};
2020
use std::sync::RwLock;
2121
use std::sync::atomic::{AtomicUsize, Ordering};
2222
use std::collections::BTreeMap;
2323
use std::collections::btree_map::Entry as BtreeEntry;
24-
use std;
2524
use std::ops::Deref;
2625

2726
/// Receives and validates network updates from peers,
@@ -224,8 +223,8 @@ pub struct DirectionalChannelInfo {
224223
pub last_update_message: Option<msgs::ChannelUpdate>,
225224
}
226225

227-
impl std::fmt::Display for DirectionalChannelInfo {
228-
fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
226+
impl fmt::Display for DirectionalChannelInfo {
227+
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
229228
write!(f, "last_update {}, enabled {}, cltv_expiry_delta {}, htlc_minimum_msat {}, fees {:?}", self.last_update, self.enabled, self.cltv_expiry_delta, self.htlc_minimum_msat, self.fees)?;
230229
Ok(())
231230
}
@@ -261,8 +260,8 @@ pub struct ChannelInfo {
261260
pub announcement_message: Option<msgs::ChannelAnnouncement>,
262261
}
263262

264-
impl std::fmt::Display for ChannelInfo {
265-
fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
263+
impl fmt::Display for ChannelInfo {
264+
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
266265
write!(f, "features: {}, node_one: {}, one_to_two: {:?}, node_two: {}, two_to_one: {:?}",
267266
log_bytes!(self.features.encode()), log_pubkey!(self.node_one), self.one_to_two, log_pubkey!(self.node_two), self.two_to_one)?;
268267
Ok(())
@@ -389,8 +388,8 @@ pub struct NodeInfo {
389388
pub announcement_info: Option<NodeAnnouncementInfo>
390389
}
391390

392-
impl std::fmt::Display for NodeInfo {
393-
fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
391+
impl fmt::Display for NodeInfo {
392+
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
394393
write!(f, "lowest_inbound_channel_fees: {:?}, channels: {:?}, announcement_info: {:?}",
395394
self.lowest_inbound_channel_fees, &self.channels[..], self.announcement_info)?;
396395
Ok(())
@@ -474,8 +473,8 @@ impl Readable for NetworkGraph {
474473
}
475474
}
476475

477-
impl std::fmt::Display for NetworkGraph {
478-
fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
476+
impl fmt::Display for NetworkGraph {
477+
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
479478
write!(f, "Network map\n[Channels]\n")?;
480479
for (key, val) in self.channels.iter() {
481480
write!(f, " {}: {}\n", key, val)?;

0 commit comments

Comments
 (0)