Simplified .filter(is_ipv4).next() to .find(is_ipv4)
See
@@ -1717,11 +1717,8 @@ fn resolve_listen_ctl_addr(input: &str) -> Result<ListenCtlAddr> {
listen_ctl_addr
.to_socket_addrs()
- .and_then(|addrs| {
- addrs
- .filter(std::net::SocketAddr::is_ipv4)
- .next()
- .ok_or_else(|| {
+ .and_then(|mut addrs| {
+ addrs.find(std::net::SocketAddr::is_ipv4).ok_or_else(|| {
io::Error::new(
io::ErrorKind::AddrNotAvailable,
"Address could not be resolved.",
