Skip to content

Commit 18662cc

Browse files
committed
Clippy fix signer and stackslib cli.rs
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent a335dcd commit 18662cc

File tree

5 files changed

+5
-12
lines changed

5 files changed

+5
-12
lines changed

stacks-signer/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ Metrics endpoint: {metrics_endpoint}
335335

336336
/// Get the chain ID for the network
337337
pub fn to_chain_id(&self) -> u32 {
338-
self.chain_id.unwrap_or_else(|| match self.network {
338+
self.chain_id.unwrap_or(match self.network {
339339
Network::Mainnet => CHAIN_ID_MAINNET,
340340
Network::Testnet | Network::Mocknet => CHAIN_ID_TESTNET,
341341
})

stacks-signer/src/main.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,7 @@ fn handle_generate_stacking_signature(
157157

158158
fn handle_check_config(args: RunSignerArgs) {
159159
let config = GlobalConfig::try_from(&args.config).unwrap();
160-
println!(
161-
"Signer version: {}\nConfig: \n{}",
162-
VERSION_STRING.to_string(),
163-
config
164-
);
160+
println!("Signer version: {}\nConfig: \n{}", *VERSION_STRING, config);
165161
}
166162

167163
fn handle_generate_vote(args: GenerateVoteArgs, do_print: bool) -> MessageSignature {

stacks-signer/src/monitoring/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ pub fn update_signer_nonce(nonce: u64) {
9797
#[allow(dead_code)]
9898
/// Remove the origin from the full path to avoid duplicate metrics for different origins
9999
fn remove_origin_from_path(full_path: &str, origin: &str) -> String {
100-
let path = full_path.replace(origin, "");
101-
path
100+
full_path.replace(origin, "")
102101
}
103102

104103
/// Start a new RPC call timer.

stacks-signer/src/v0/signer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl SignerTrait<SignerMessage> for Signer {
191191
"block_height" => b.header.chain_length,
192192
"signer_sighash" => %b.header.signer_signature_hash(),
193193
);
194-
stacks_client.post_block_until_ok(self, &b);
194+
stacks_client.post_block_until_ok(self, b);
195195
}
196196
SignerMessage::MockProposal(mock_proposal) => {
197197
let epoch = match stacks_client.get_node_epoch() {

stackslib/src/cli.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,6 @@ fn replay_block(
528528
fn replay_block_nakamoto(
529529
sort_db: &mut SortitionDB,
530530
stacks_chain_state: &mut StacksChainState,
531-
mut chainstate_tx: ChainstateTx,
532-
clarity_instance: &mut ClarityInstance,
533531
block: &NakamotoBlock,
534532
block_size: u64,
535533
) -> Result<(), ChainstateError> {
@@ -785,7 +783,7 @@ fn replay_block_nakamoto(
785783
return Err(e);
786784
};
787785

788-
let (receipt, clarity_commit, reward_set_data) = ok_opt.expect("FATAL: unreachable");
786+
let (receipt, _clarity_commit, _reward_set_data) = ok_opt.expect("FATAL: unreachable");
789787

790788
assert_eq!(
791789
receipt.header.anchored_header.block_hash(),

0 commit comments

Comments
 (0)