Skip to content

Commit

Permalink
fixup: use first(), not get(0)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlon committed Nov 22, 2024
1 parent 17933c3 commit f31df17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mullvad-api/src/https_client_with_sni.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ impl HttpsConnectorWithSni {
//
let addrs = dns_resolver.resolve(hostname.to_owned()).await?;
let addr = addrs
.get(0)
.first()
.ok_or_else(|| io::Error::new(io::ErrorKind::Other, "Empty DNS response"))?;
Ok(SocketAddr::new(*addr, port.unwrap_or(DEFAULT_PORT)))
}
Expand Down

0 comments on commit f31df17

Please sign in to comment.