Skip to content

Commit

Permalink
clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cndolo committed Jul 6, 2024
1 parent 217dcac commit 241ef92
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 3 additions & 1 deletion network-parser/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ impl Node {
if i == 0 {
// the network part which always seems to be tcp
match part {
"ipv4" | "ipv6" | "torv2" | "torv3" => addr.network = "tcp".to_owned(),
"ipv4" | "ipv6" | "torv2" | "torv3" => {
"tcp".clone_into(&mut addr.network)
}
_ => {
break;
}
Expand Down
2 changes: 1 addition & 1 deletion simulator/src/payments/attempt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl Simulation {
&channel_id,
current_balance + remaining_transferable_amount,
);
payment_shard.used_path = candidate_path.to_owned();
candidate_path.clone_into(&mut payment_shard.used_path);
// TODO: remove invoice
info!(
"Successfully delivered payment of {} msats from {} to {}.",
Expand Down
8 changes: 2 additions & 6 deletions simulator/src/stats/deanonymisation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,9 @@ impl Simulation {
// stores (src, dest): path
let mut shortest_paths: HashMap<(ID, ID), CandidatePath> = HashMap::new();
// and capacity
let phase1_paths = if let Some(paths) =
let phase1_paths =
Self::get_all_reachable_paths(&g, &succ, amount_to_succ, ttl_to_rx)
{
paths
} else {
vec![]
};
.unwrap_or_default();
// for all Pi for a list of potential recipients as R and potential senders for each such recipient
// The union of the potential senders for all potential recipients is the sender anonymity set
info!(
Expand Down
4 changes: 2 additions & 2 deletions simulator/src/traversal/mpp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ impl Simulation {
failed = true;
} else if let Some(shards) = Payment::split_payment(&current_shard) {
let (mut shard1, mut shard2) = (shards.0, shards.1);
shard1.failed_amounts = root.failed_amounts.clone();
shard2.failed_amounts = root.failed_amounts.clone();
root.failed_amounts.clone_into(&mut shard1.failed_amounts);
root.failed_amounts.clone_into(&mut shard2.failed_amounts);
stack.push(shard1);
stack.push(shard2);
} else {
Expand Down

0 comments on commit 241ef92

Please sign in to comment.