Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/fix clippy perf warnings #4567

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions stacks-signer/src/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ impl Signer {
block_info.valid = Some(is_valid);
self.signer_db
.insert_block(self.reward_cycle, &block_info)
.expect(&format!("{self}: Failed to insert block in DB"));
.unwrap_or_else(|_| panic!("{self}: Failed to insert block in DB"));
info!(
"{self}: Treating block validation for block {} as valid: {:?}",
&block_info.block.block_id(),
Expand Down Expand Up @@ -504,7 +504,7 @@ impl Signer {
}
self.signer_db
.insert_block(self.reward_cycle, &block_info)
.expect(&format!("{self}: Failed to insert block in DB"));
.unwrap_or_else(|_| panic!("{self}: Failed to insert block in DB"));
}

/// Handle signer messages submitted to signers stackerdb
Expand Down Expand Up @@ -640,7 +640,7 @@ impl Signer {
match self
.signer_db
.block_lookup(self.reward_cycle, &block_vote.signer_signature_hash)
.expect(&format!("{self}: Failed to connect to DB"))
.unwrap_or_else(|_| panic!("{self}: Failed to connect to DB"))
.map(|b| b.vote)
{
Some(Some(vote)) => {
Expand Down Expand Up @@ -702,7 +702,7 @@ impl Signer {
let block_info = BlockInfo::new_with_request(block.clone(), nonce_request.clone());
self.signer_db
.insert_block(self.reward_cycle, &block_info)
.expect(&format!("{self}: Failed to insert block in DB"));
.unwrap_or_else(|_| panic!("{self}: Failed to insert block in DB"));
stacks_client
.submit_block_for_validation(block)
.unwrap_or_else(|e| {
Expand All @@ -722,7 +722,7 @@ impl Signer {
self.determine_vote(&mut block_info, nonce_request);
self.signer_db
.insert_block(self.reward_cycle, &block_info)
.expect(&format!("{self}: Failed to insert block in DB"));
.unwrap_or_else(|_| panic!("{self}: Failed to insert block in DB"));
true
}

Expand Down Expand Up @@ -1082,7 +1082,7 @@ impl Signer {
let Some(block_info) = self
.signer_db
.block_lookup(self.reward_cycle, &block_vote.signer_signature_hash)
.expect(&format!("{self}: Failed to connect to signer DB"))
.unwrap_or_else(|_| panic!("{self}: Failed to connect to signer DB"))
else {
debug!(
"{self}: Received a signature result for a block we have not seen before. Ignoring..."
Expand Down