Skip to content

Commit

Permalink
[Easy] Fix clippy for rust v1.78 (#2687)
Browse files Browse the repository at this point in the history
# Description
Lint fails on most recent master with newest rust version

# Changes
Fix clippy warnings

## How to test
CI

<!--
## Related Issues

Fixes #
-->
  • Loading branch information
fleupold authored May 2, 2024
1 parent 9eb8e07 commit 52f6863
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/driver/src/domain/competition/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ impl Competition {
})
.unzip();

*self.settlement.lock().unwrap() = settlement.clone();
self.settlement.lock().unwrap().clone_from(&settlement);

let settlement = match settlement {
Some(settlement) => settlement,
Expand Down
4 changes: 2 additions & 2 deletions crates/shared/src/recent_block_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ mod tests {
TestValue::new(2, "1"),
TestValue::new(3, "1"),
];
*values.lock().unwrap() = initial_values.clone();
values.lock().unwrap().clone_from(&initial_values);

let result = cache
.fetch(test_keys(0..2), Block::Number(block_number))
Expand All @@ -638,7 +638,7 @@ mod tests {
TestValue::new(2, "2"),
TestValue::new(3, "2"),
];
*values.lock().unwrap() = updated_values.clone();
values.lock().unwrap().clone_from(&updated_values);
cache.update_cache_at_block(block_number).await.unwrap();
values.lock().unwrap().clear();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ mod tests {

// Everything old from block 3 on is gone.
for pool_id in pool_ids.iter().take(6).skip(3) {
assert!(pool_store.pools.get(pool_id).is_none());
assert!(!pool_store.pools.contains_key(pool_id));
}
for token in tokens.iter().take(7).skip(4) {
assert!(pool_store.pools_by_token.get(token).unwrap().is_empty());
Expand All @@ -513,8 +513,7 @@ mod tests {

assert!(pool_store
.pools_by_token
.get(&new_pool.common.tokens[0])
.is_some());
.contains_key(&new_pool.common.tokens[0]));
assert_eq!(pool_store.last_event_block(), new_pool.common.block_created);
}

Expand Down

0 comments on commit 52f6863

Please sign in to comment.