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

Clippy fix signer and stackslib cli.rs #5410

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stacks-signer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ Metrics endpoint: {metrics_endpoint}

/// Get the chain ID for the network
pub fn to_chain_id(&self) -> u32 {
self.chain_id.unwrap_or_else(|| match self.network {
self.chain_id.unwrap_or(match self.network {
Network::Mainnet => CHAIN_ID_MAINNET,
Network::Testnet | Network::Mocknet => CHAIN_ID_TESTNET,
})
Expand Down
6 changes: 1 addition & 5 deletions stacks-signer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,7 @@ fn handle_generate_stacking_signature(

fn handle_check_config(args: RunSignerArgs) {
let config = GlobalConfig::try_from(&args.config).unwrap();
println!(
"Signer version: {}\nConfig: \n{}",
VERSION_STRING.to_string(),
config
);
println!("Signer version: {}\nConfig: \n{}", *VERSION_STRING, config);
}

fn handle_generate_vote(args: GenerateVoteArgs, do_print: bool) -> MessageSignature {
Expand Down
3 changes: 1 addition & 2 deletions stacks-signer/src/monitoring/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ pub fn update_signer_nonce(nonce: u64) {
#[allow(dead_code)]
/// Remove the origin from the full path to avoid duplicate metrics for different origins
fn remove_origin_from_path(full_path: &str, origin: &str) -> String {
let path = full_path.replace(origin, "");
path
full_path.replace(origin, "")
}

/// Start a new RPC call timer.
Expand Down
2 changes: 1 addition & 1 deletion stacks-signer/src/v0/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ impl SignerTrait<SignerMessage> for Signer {
"block_height" => b.header.chain_length,
"signer_sighash" => %b.header.signer_signature_hash(),
);
stacks_client.post_block_until_ok(self, &b);
stacks_client.post_block_until_ok(self, b);
}
SignerMessage::MockProposal(mock_proposal) => {
let epoch = match stacks_client.get_node_epoch() {
Expand Down
4 changes: 1 addition & 3 deletions stackslib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,6 @@ fn replay_block(
fn replay_block_nakamoto(
sort_db: &mut SortitionDB,
stacks_chain_state: &mut StacksChainState,
mut chainstate_tx: ChainstateTx,
clarity_instance: &mut ClarityInstance,
block: &NakamotoBlock,
block_size: u64,
) -> Result<(), ChainstateError> {
Expand Down Expand Up @@ -785,7 +783,7 @@ fn replay_block_nakamoto(
return Err(e);
};

let (receipt, clarity_commit, reward_set_data) = ok_opt.expect("FATAL: unreachable");
let (receipt, _clarity_commit, _reward_set_data) = ok_opt.expect("FATAL: unreachable");

assert_eq!(
receipt.header.anchored_header.block_hash(),
Expand Down
Loading