trivial changes to fix clippy::write_with_newline warnings
authorRyan Loomba <ryan@loomba.io>
Thu, 8 Oct 2020 22:46:43 +0000 (15:46 -0700)
committerRyan Loomba <ryan@loomba.io>
Thu, 8 Oct 2020 23:06:03 +0000 (16:06 -0700)
lightning/src/routing/network_graph.rs
lightning/src/util/macro_logger.rs

index cafe4fc10a38f5c51259256c3c87fe6e1248a90b..308c0526eb58cc84207abce8c27d114a059e0bcc 100644 (file)
@@ -518,13 +518,13 @@ impl Readable for NetworkGraph {
 
 impl fmt::Display for NetworkGraph {
        fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
-               write!(f, "Network map\n[Channels]\n")?;
+               writeln!(f, "Network map\n[Channels]")?;
                for (key, val) in self.channels.iter() {
-                       write!(f, " {}: {}\n", key, val)?;
+                       writeln!(f, " {}: {}", key, val)?;
                }
-               write!(f, "[Nodes]\n")?;
+               writeln!(f, "[Nodes]")?;
                for (key, val) in self.nodes.iter() {
-                       write!(f, " {}: {}\n", log_pubkey!(key), val)?;
+                       writeln!(f, " {}: {}", log_pubkey!(key), val)?;
                }
                Ok(())
        }
index c2c5122d06c47e040db0c6da264d24c6616b8bb6..e667c4d726c5f2075907d9c9f4c2ea465fb8e137 100644 (file)
@@ -80,9 +80,9 @@ pub(crate) struct DebugRoute<'a>(pub &'a Route);
 impl<'a> std::fmt::Display for DebugRoute<'a> {
        fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
                for (idx, p) in self.0.paths.iter().enumerate() {
-                       write!(f, "path {}:\n", idx)?;
+                       writeln!(f, "path {}:", idx)?;
                        for h in p.iter() {
-                               write!(f, " node_id: {}, short_channel_id: {}, fee_msat: {}, cltv_expiry_delta: {}\n", log_pubkey!(h.pubkey), h.short_channel_id, h.fee_msat, h.cltv_expiry_delta)?;
+                               writeln!(f, " node_id: {}, short_channel_id: {}, fee_msat: {}, cltv_expiry_delta: {}", log_pubkey!(h.pubkey), h.short_channel_id, h.fee_msat, h.cltv_expiry_delta)?;
                        }
                }
                Ok(())