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

Fix Clippy lints, 0.5 branch #2420

Merged
merged 1 commit into from
Jan 2, 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
10 changes: 5 additions & 5 deletions aggregator/src/aggregator/http_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,7 @@ mod tests {
// Validate response.
assert_eq!(aggregate_resp.prepare_steps().len(), 9);

let prepare_step_0 = aggregate_resp.prepare_steps().get(0).unwrap();
let prepare_step_0 = aggregate_resp.prepare_steps().first().unwrap();
assert_eq!(prepare_step_0.report_id(), report_share_0.metadata().id());
assert_matches!(prepare_step_0.result(), &PrepareStepResult::Continued(..));

Expand Down Expand Up @@ -2218,7 +2218,7 @@ mod tests {
// Validate response.
assert_eq!(aggregate_resp.prepare_steps().len(), 4);

let prepare_step_same_id = aggregate_resp.prepare_steps().get(0).unwrap();
let prepare_step_same_id = aggregate_resp.prepare_steps().first().unwrap();
assert_eq!(
prepare_step_same_id.report_id(),
report_share_same_id.metadata().id()
Expand Down Expand Up @@ -2297,7 +2297,7 @@ mod tests {

assert_eq!(aggregate_resp.prepare_steps().len(), 1);

let prepare_step = aggregate_resp.prepare_steps().get(0).unwrap();
let prepare_step = aggregate_resp.prepare_steps().first().unwrap();
assert_eq!(
prepare_step.report_id(),
mutated_timestamp_report_share.metadata().id()
Expand Down Expand Up @@ -2388,7 +2388,7 @@ mod tests {
// Validate response.
assert_eq!(aggregate_resp.prepare_steps().len(), 1);

let prepare_step = aggregate_resp.prepare_steps().get(0).unwrap();
let prepare_step = aggregate_resp.prepare_steps().first().unwrap();
assert_eq!(prepare_step.report_id(), report_share.metadata().id());
assert_matches!(
prepare_step.result(),
Expand Down Expand Up @@ -2458,7 +2458,7 @@ mod tests {
// Validate response.
assert_eq!(aggregate_resp.prepare_steps().len(), 1);

let prepare_step = aggregate_resp.prepare_steps().get(0).unwrap();
let prepare_step = aggregate_resp.prepare_steps().first().unwrap();
assert_eq!(prepare_step.report_id(), report_share.metadata().id());
assert_matches!(
prepare_step.result(),
Expand Down
2 changes: 1 addition & 1 deletion aggregator/src/aggregator/taskprov_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ async fn taskprov_aggregate_init() {
let aggregate_resp = AggregationJobResp::get_decoded(&body_bytes).unwrap();

assert_eq!(aggregate_resp.prepare_steps().len(), 1);
let prepare_step = aggregate_resp.prepare_steps().get(0).unwrap();
let prepare_step = aggregate_resp.prepare_steps().first().unwrap();
assert_eq!(prepare_step.report_id(), test.report_share.metadata().id());
assert_matches!(prepare_step.result(), &PrepareStepResult::Continued(..));

Expand Down
2 changes: 1 addition & 1 deletion client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub async fn aggregator_hpke_config(
// we support any HpkeConfig we can decode, and it should be the server's preferred one.
let hpke_config = hpke_configs
.hpke_configs()
.get(0)
.first()
.ok_or(Error::UnexpectedServerResponse(
"aggregator provided empty HpkeConfigList",
))?
Expand Down
2 changes: 1 addition & 1 deletion core/src/test_util/kubernetes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl Cluster {
let matching_pods = pods.list(&lp).await.unwrap();
let pod = matching_pods
.items
.get(0)
.first()
.unwrap_or_else(|| panic!("could not find any pods for the service {service_name}"));
let pod_name = pod.name_unchecked();

Expand Down
Loading