diff --git a/barq-common/src/algorithms/probabilistic/mod.rs b/barq-common/src/algorithms/probabilistic/mod.rs index 20f6348..1f9ee72 100644 --- a/barq-common/src/algorithms/probabilistic/mod.rs +++ b/barq-common/src/algorithms/probabilistic/mod.rs @@ -66,7 +66,8 @@ where L: Deref, L::Target: Logger, { - /// Determines if the LDK routing strategy can be applied to the given input. + /// Determines if the LDK routing strategy can be applied to the given + /// input. /// /// This method checks if the network graph has the peer-to-peer information /// required for LDK routing. diff --git a/barq-common/src/graph.rs b/barq-common/src/graph.rs index 90cfbc7..c8230e8 100644 --- a/barq-common/src/graph.rs +++ b/barq-common/src/graph.rs @@ -69,7 +69,8 @@ impl Channel { } } -/// Trait for handling network graphs with channels, nodes, and peer-to-peer information. +/// Trait for handling network graphs with channels, nodes, and peer-to-peer +/// information. pub trait NetworkGraph { /// Gets all channels in the network graph. fn get_channels(&self) -> Vec<&Channel>; @@ -83,6 +84,7 @@ pub trait NetworkGraph { /// Gets a channel by its ID. fn get_channel(&self, id: &str) -> Option<&Channel>; - /// Whether or not the network graph has peer-to-peer information (e.g., gossip map). + /// Whether or not the network graph has peer-to-peer information (e.g., + /// gossip map). fn has_p2p_info(&self) -> bool; } diff --git a/barq-plugin/src/methods/graph/cln.rs b/barq-plugin/src/methods/graph/cln.rs index ba4d674..19b011e 100644 --- a/barq-plugin/src/methods/graph/cln.rs +++ b/barq-plugin/src/methods/graph/cln.rs @@ -1,7 +1,6 @@ use std::collections::HashMap; -use serde::Deserialize; -use serde::Serialize; +use serde::{Deserialize, Serialize}; use clightningrpc_plugin::error; use clightningrpc_plugin::errors::PluginError; diff --git a/barq-plugin/src/methods/graph/p2p.rs b/barq-plugin/src/methods/graph/p2p.rs index fb867fe..81a94be 100644 --- a/barq-plugin/src/methods/graph/p2p.rs +++ b/barq-plugin/src/methods/graph/p2p.rs @@ -2,8 +2,7 @@ use std::collections::HashMap; -use serde::Deserialize; -use serde::Serialize; +use serde::{Deserialize, Serialize}; use clightningrpc_gossip_map::GossipMap; use clightningrpc_plugin::{error, errors::PluginError}; diff --git a/barq-plugin/src/methods/pay.rs b/barq-plugin/src/methods/pay.rs index 2c17a12..9f6be31 100644 --- a/barq-plugin/src/methods/pay.rs +++ b/barq-plugin/src/methods/pay.rs @@ -133,8 +133,8 @@ pub fn barq_pay( )); } - // If the probabilistic strategy is selected, build the network graph from the gossip map - // else, build the network graph from the plugin state + // If the probabilistic strategy is selected, build the network graph from the + // gossip map. Else, build the network graph from the plugin state let network_graph: Box = match request.strategy().map_err(|e| error!("{e}"))? { StrategyKind::Direct => Box::new(build_cln_network_graph(state)?), diff --git a/barq-plugin/src/methods/route_info.rs b/barq-plugin/src/methods/route_info.rs index 0e2733b..8d719bd 100644 --- a/barq-plugin/src/methods/route_info.rs +++ b/barq-plugin/src/methods/route_info.rs @@ -58,8 +58,8 @@ pub fn barq_route_info(plugin: &mut Plugin, request: Value) -> Result = match request.strategy().map_err(|e| error!("{e}"))? { StrategyKind::Direct => Box::new(build_cln_network_graph(state)?),