Skip to content

Commit

Permalink
[rust] Select release with artifact when filtering Edge response
Browse files Browse the repository at this point in the history
  • Loading branch information
bonigarcia committed Mar 25, 2024
1 parent 75dc259 commit a5ac402
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rust/src/edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,15 @@ impl SeleniumManager for EdgeManager {
return self.unavailable_discovery();
}

let release = releases.first().unwrap();
let releases_with_artifacts: Vec<&Release> = releases
.into_iter()
.filter(|r| !r.artifacts.is_empty())
.collect();
if releases_with_artifacts.is_empty() {
return self.unavailable_discovery();
}

let release = releases_with_artifacts.first().unwrap();
let artifacts: Vec<&Artifact> = release
.artifacts
.iter()
Expand Down

0 comments on commit a5ac402

Please sign in to comment.