Skip to content

Commit

Permalink
chore: lint fix due to rust version update to 1.73
Browse files Browse the repository at this point in the history
  • Loading branch information
gk-kindred committed Oct 9, 2023
1 parent 02afa13 commit fe0dbbf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 29 deletions.
21 changes: 9 additions & 12 deletions examples/agent_client/examples/agent_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,18 +275,15 @@ async fn get_params() -> Result<LaunchParams, String> {
}
}

if stop_type.is_none() {
Err("Parameter --volume is required".into())
} else if target_rate.is_none() {
Err("Parameter --rate is required".into())
} else {
Ok(LaunchParams {
target_rate: target_rate.unwrap(),
stop_type: stop_type.unwrap(),
threads: threads.unwrap(),
collect_metrics: collect_metrics.unwrap(),
})
}
let stop_type = stop_type.ok_or("Parameter --volume is required")?;
let target_rate = target_rate.ok_or("Parameter --rate is required")?;

Ok(LaunchParams {
target_rate,
stop_type,
threads: threads.unwrap(),
collect_metrics: collect_metrics.unwrap(),
})
}

struct RequestGenerator {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,22 +263,18 @@ async fn get_params() -> Result<LaunchParams, String> {
}
}

if stop_type.is_none() {
Err("Parameter --volume is required".into())
} else if accounts.is_none() {
Err("Parameter --accounts is required".into())
} else if target_rate.is_none() {
Err("Parameter --rate is required".into())
} else {
Ok(LaunchParams {
target_rate: target_rate.unwrap(),
stop_type: stop_type.unwrap(),
threads: threads.unwrap(),
accounts: accounts.unwrap(),
scaling_config: scaling_config.unwrap_or(HashMap::new()),
metric_print_raw: metric_print_raw.is_some(),
})
}
let stop_type = stop_type.ok_or("Parameter --volume is required")?;
let target_rate = target_rate.ok_or("Parameter --rate is required")?;
let accounts = accounts.ok_or("Parameter --accounts is required")?;

Ok(LaunchParams {
target_rate,
stop_type,
threads: threads.unwrap(),
accounts,
scaling_config: scaling_config.unwrap_or_default(),
metric_print_raw: metric_print_raw.is_some(),
})
}

struct TransferRequestGenerator {
Expand Down
3 changes: 2 additions & 1 deletion packages/talos_suffix/src/suffix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ where
pub fn retrieve_all_some_vec_items(&self) -> Vec<(usize, u64, Option<u64>)> {
self.messages
.iter()
.flatten()
.enumerate()
.filter_map(|(i, x)| x.is_some().then(|| (i, x.as_ref().unwrap().item_ver, x.as_ref().unwrap().decision_ver)))
.map(|(i, x)| (i, x.item_ver, x.decision_ver))
.collect()
}

Expand Down

0 comments on commit fe0dbbf

Please sign in to comment.