Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ackintosh committed Feb 28, 2024
1 parent 28dff34 commit ce3eab3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions beacon_node/lighthouse_network/src/discovery/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -765,17 +765,16 @@ impl<TSpec: EthSpec> Discovery<TSpec> {
DiscoveryTarget::Prefix(node_ids) => {
let pos = prefix_query.retries % node_ids.len();
if let Some(id) = node_ids.get(pos) {
id.clone()
*id
} else {
warn!(
self.log,
"NodeIds were given for prefix search, but the offset was wrong. Choosing the first one instead.";
"subnet" => ?prefix_query,
);
node_ids
*node_ids
.first()
.expect("Already checked that `node_ids` is not empty.")
.clone()
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion consensus/types/src/subnet_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ mod tests {
assert_eq!(mapping.len(), 64);

for (_, node_ids) in mapping.into_iter() {
assert!(node_ids.len() > 0);
assert!(!node_ids.is_empty());
}
}
}
Expand Down

0 comments on commit ce3eab3

Please sign in to comment.