Skip to content

Commit

Permalink
fix: cargo fmt --all
Browse files Browse the repository at this point in the history
Signed-off-by: Tarek <[email protected]>
  • Loading branch information
tareknaser authored and vincenzopalazzo committed Jul 29, 2024
1 parent b215e0b commit fd4e690
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion barq-common/src/algorithms/probabilistic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions barq-common/src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand All @@ -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;
}
3 changes: 1 addition & 2 deletions barq-plugin/src/methods/graph/cln.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 1 addition & 2 deletions barq-plugin/src/methods/graph/p2p.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
4 changes: 2 additions & 2 deletions barq-plugin/src/methods/pay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<dyn NetworkGraph> =
match request.strategy().map_err(|e| error!("{e}"))? {
StrategyKind::Direct => Box::new(build_cln_network_graph(state)?),
Expand Down
4 changes: 2 additions & 2 deletions barq-plugin/src/methods/route_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ pub fn barq_route_info(plugin: &mut Plugin<State>, request: Value) -> Result<Val
.call("getinfo", serde_json::json!({}))
.map_err(|err| error!("Error calling CLN RPC method: {err}"))?;

// 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<dyn NetworkGraph> =
match request.strategy().map_err(|e| error!("{e}"))? {
StrategyKind::Direct => Box::new(build_cln_network_graph(state)?),
Expand Down

0 comments on commit fd4e690

Please sign in to comment.