Skip to content

Commit

Permalink
fix clippy 1.52 lints
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-babichenko committed May 6, 2021
1 parent 5ef1b14 commit fc40aee
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 20 deletions.
4 changes: 2 additions & 2 deletions jormungandr/src/blockchain/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,10 @@ impl Blockchain {
header,
epoch_leadership_schedule,
epoch_ledger_parameters,
epoch_rewards_info,
parent_ledger_state,
time_frame,
previous_epoch_state,
epoch_rewards_info,
})
}

Expand Down Expand Up @@ -613,10 +613,10 @@ impl Blockchain {
header,
epoch_leadership_schedule,
epoch_ledger_parameters,
epoch_rewards_info,
parent_ledger_state,
time_frame,
previous_epoch_state,
epoch_rewards_info,
};

self.apply_block_check_rewards(&post_checked_header, &new_ledger)?;
Expand Down
2 changes: 1 addition & 1 deletion jormungandr/src/explorer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ impl ExplorerDb {
let initial_state = State {
transactions,
blocks,
addresses,
epochs,
chain_lengths,
addresses,
stake_pool_data,
stake_pool_blocks,
vote_plans,
Expand Down
2 changes: 1 addition & 1 deletion jormungandr/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,9 @@ fn bootstrap(initialized_node: InitializedNode) -> Result<BootstrappedNode, star

Ok(BootstrappedNode {
settings,
block0_hash,
blockchain,
blockchain_tip,
block0_hash,
explorer_db,
rest_context,
services,
Expand Down
2 changes: 1 addition & 1 deletion jormungandr/src/network/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ impl NodeService {
let span = span!(parent: global_state.span(), Level::TRACE, "sub_task", kind = "server");
NodeService {
channels,
span,
global_state,
span,
}
}

Expand Down
2 changes: 1 addition & 1 deletion jormungandr/src/topology/layers/rings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ pub struct Rings {
impl Rings {
pub fn new(interest_levels: RingsConfig, rings: poldercast::layer::Rings) -> Self {
Self {
interest_levels,
rings,
interest_levels,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/blockchain/src/reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ impl Reference {
let previous_epoch_state = None;

Ok(Self {
header,
ledger,
header,
epoch_info,
previous_epoch_state,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ impl<'a> FragmentCheck<'a> {
pub fn new(jcli: JCli, jormungandr: &'a JormungandrProcess, id: FragmentId) -> Self {
Self {
jcli,
jormungandr,
id,
jormungandr,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,9 @@ impl Starter {
}

pub fn start_benchmark_run(&self) -> Option<SpeedBenchmarkRun> {
match &self.benchmark {
Some(benchmark_def) => Some(benchmark_def.clone().target(self.timeout).start()),
None => None,
}
self.benchmark
.as_ref()
.map(|benchmark_def| benchmark_def.clone().target(self.timeout).start())
}

pub fn finish_benchmark(&self, benchmark_run: Option<SpeedBenchmarkRun>) {
Expand Down Expand Up @@ -296,8 +295,8 @@ impl<'a> ConfiguredStarter<'a, legacy::NodeConfig> {
params.write_node_config();
Ok(ConfiguredStarter {
starter,
temp_dir,
params,
temp_dir,
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ impl Controller {

Ok(Controller {
settings,
working_directory,
block0_file,
block0_hash,
working_directory,
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,12 @@ impl FaultyTransactionBuilder {
let input_value = self.fees.calculate(None, 1, 1).saturating_add(Value(1u64));
let input = from.add_input_with_value(input_value.into());
let output = OutputAddress::from_address(to.address().into(), Value(1u64));
self.transaction_to(&[input], &[output], |_sign_data| vec![])
self.transaction_to(&[input], &[output], |_sign_data| Vec::new())
}

pub fn no_input(&self, to: &Wallet) -> Fragment {
let output = Output::from_address(to.address().into(), Value(1u64));
self.transaction_to(&[], &[output], |_sign_data| vec![])
self.transaction_to(&[], &[output], |_sign_data| Vec::new())
}

pub fn no_output(&self, from: &Wallet) -> Fragment {
Expand All @@ -334,7 +334,7 @@ impl FaultyTransactionBuilder {
}

pub fn empty(&self) -> Fragment {
self.transaction_to(&[], &[], |_sign_data| vec![])
self.transaction_to(&[], &[], |_sign_data| Vec::new())
}

pub fn wrong_counter(&self, from: &Wallet, to: &Wallet) -> Fragment {
Expand Down
4 changes: 1 addition & 3 deletions testing/mjolnir/src/mjolnir_app/bootstrap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ impl ClientLoadCommand {
pub fn exec(&self) -> Result<(), ClientLoadCommandError> {
let scenario_type = if let Some(duration) = self.duration {
Some(ScenarioType::Duration(duration))
} else if let Some(iteration) = self.sync_iteration {
Some(ScenarioType::Iteration(iteration))
} else {
None
self.sync_iteration.map(ScenarioType::Iteration)
};

if scenario_type.is_none() {
Expand Down

0 comments on commit fc40aee

Please sign in to comment.