Skip to content

Commit

Permalink
Clippy some more goodness
Browse files Browse the repository at this point in the history
  • Loading branch information
ThetaSinner committed Mar 5, 2024
1 parent 9431847 commit 16d9148
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions framework/runner/src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ pub struct AssignedBehaviour {
/// The result of combining a scenario builder with the input CLI arguments to produce a scenario definition.
pub struct ScenarioDefinition<RV: UserValuesConstraint, V: UserValuesConstraint> {
pub(crate) name: String,
pub(crate) agent_count: usize,
pub(crate) assigned_behaviours: Vec<AssignedBehaviour>,
pub(crate) duration_s: Option<u64>,
pub(crate) connection_string: String,
Expand Down Expand Up @@ -201,7 +200,6 @@ impl<RV: UserValuesConstraint, V: UserValuesConstraint> ScenarioDefinitionBuilde

Ok(ScenarioDefinition {
name: self.name,
agent_count: resolved_agent_count,
assigned_behaviours: build_assigned_behaviours(&self.cli, resolved_agent_count)?,
duration_s: resolved_duration,
connection_string: self.cli.connection_string,
Expand Down
4 changes: 2 additions & 2 deletions framework/runner/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ pub fn run<RV: UserValuesConstraint, V: UserValuesConstraint>(
let assigned_behaviours = definition.assigned_behaviours_flat();

let mut handles = Vec::new();
for agent_index in 0..definition.agent_count {
for (agent_index, assigned_behaviour) in assigned_behaviours.iter().enumerate() {
// Read access to the runner context for each agent
let runner_context = runner_context.clone();

let setup_agent_fn = definition.setup_agent_fn;
let agent_behaviour_fn = definition
.agent_behaviour
.get(&assigned_behaviours[agent_index])
.get(assigned_behaviour)
.cloned();
let teardown_agent_fn = definition.teardown_agent_fn;

Expand Down

0 comments on commit 16d9148

Please sign in to comment.