Fix clippy "unnecessary Vec::push" lints

This commit is contained in:
teor 2021-01-22 13:57:49 +10:00 committed by Jane Lusby
parent 00c3ad5d8e
commit 494a5130c1
2 changed files with 4 additions and 6 deletions

View File

@ -393,8 +393,7 @@ fn founders_reward_validation_failure() -> Result<(), Report> {
.unwrap(); .unwrap();
// Build new block // Build new block
let mut transactions: Vec<Arc<zebra_chain::transaction::Transaction>> = Vec::new(); let transactions: Vec<Arc<zebra_chain::transaction::Transaction>> = vec![Arc::new(tx)];
transactions.push(Arc::new(tx));
let block = Block { let block = Block {
header: block.header, header: block.header,
transactions, transactions,

View File

@ -122,14 +122,13 @@ where
let default_config_path = path.join("zebrad.toml"); let default_config_path = path.join("zebrad.toml");
if default_config_path.exists() { if default_config_path.exists() {
let mut extra_args: Vec<_> = Vec::new(); let mut extra_args: Vec<_> = vec![
extra_args.push("-c"); "-c",
extra_args.push(
default_config_path default_config_path
.as_path() .as_path()
.to_str() .to_str()
.expect("Path is valid Unicode"), .expect("Path is valid Unicode"),
); ];
extra_args.extend_from_slice(args); extra_args.extend_from_slice(args);
self.spawn_child_with_command(env!("CARGO_BIN_EXE_zebrad"), &extra_args) self.spawn_child_with_command(env!("CARGO_BIN_EXE_zebrad"), &extra_args)
} else { } else {