Skip to content

Commit

Permalink
fix lints. (kaspanet#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Stacks committed Feb 17, 2024
1 parent b99ed79 commit 374ee2f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mining/src/model/topological_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ where
Ok(sorted)
}

fn check_topological_order(&'a self, sorted: &Vec<TKey>) -> TopologicalIndexResult<()> {
fn check_topological_order(&'a self, sorted: &[TKey]) -> TopologicalIndexResult<()> {
let nodes = self.topology_nodes().collect::<HashSet<_>>();
if sorted.len() != nodes.len() {
return Err(TopologicalIndexError::IndexHasWrongKeySet);
Expand Down
4 changes: 2 additions & 2 deletions rothschild/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ async fn main() {

fn should_maximize_inputs(
old_value: bool,
utxos: &Vec<(TransactionOutpoint, UtxoEntry)>,
utxos: &[(TransactionOutpoint, UtxoEntry)],
pending: &HashMap<TransactionOutpoint, u64>,
) -> bool {
let estimated_utxos = if utxos.len() > pending.len() { utxos.len() - pending.len() } else { 0 };
Expand Down Expand Up @@ -353,7 +353,7 @@ async fn maybe_send_tx(
txs_to_send: u64,
tx_sender: &async_channel::Sender<ClientPoolArg>,
kaspa_addr: Address,
utxos: &mut Vec<(TransactionOutpoint, UtxoEntry)>,
utxos: &mut [(TransactionOutpoint, UtxoEntry)],
pending: &mut HashMap<TransactionOutpoint, u64>,
schnorr_key: KeyPair,
stats: Arc<Mutex<Stats>>,
Expand Down
4 changes: 2 additions & 2 deletions rpc/grpc/core/src/convert/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ mod tests {
RpcHash::from_u64_word(c)
}

fn test_parents_by_level_rxr(r: &Vec<Vec<RpcHash>>, r2: &[Vec<RpcHash>]) {
fn test_parents_by_level_rxr(r: &[Vec<RpcHash>], r2: &[Vec<RpcHash>]) {
for i in 0..r.len() {
for j in 0..r[i].len() {
assert_eq!(r[i][j], r2[i][j]);
}
}
}
fn test_parents_by_level_rxp(r: &Vec<Vec<RpcHash>>, p: &[protowire::RpcBlockLevelParents]) {
fn test_parents_by_level_rxp(r: &[Vec<RpcHash>], p: &[protowire::RpcBlockLevelParents]) {
for i in 0..r.len() {
for j in 0..r[i].len() {
assert_eq!(r[i][j].to_string(), p[i].parent_hashes[j]);
Expand Down
2 changes: 1 addition & 1 deletion testing/integration/src/common/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub fn generate_tx_dag(
}

/// Sanity test verifying that the generated TX DAG is valid, topologically ordered and has no double spends
pub fn verify_tx_dag(initial_utxoset: &UtxoCollection, txs: &Vec<Arc<Transaction>>) {
pub fn verify_tx_dag(initial_utxoset: &UtxoCollection, txs: &[Arc<Transaction>]) {
let mut prev_txs: HashMap<TransactionId, Arc<Transaction>> = HashMap::new();
let mut used_outpoints = HashSet::with_capacity(txs.len() * 2);
for tx in txs.iter() {
Expand Down

0 comments on commit 374ee2f

Please sign in to comment.