No need to create a new SocketAddr.
This commit is contained in:
parent
fd7c9198d0
commit
40786f3290
|
@ -1,7 +1,7 @@
|
|||
//! Chaturbate Streams Recorder
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::net::{IpAddr, SocketAddr, ToSocketAddrs};
|
||||
use std::net::{IpAddr, ToSocketAddrs};
|
||||
use std::thread;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
|
@ -71,10 +71,7 @@ impl Chaturbate {
|
|||
.timeout_read(Duration::from_secs(5))
|
||||
.timeout_write(Duration::from_secs(5))
|
||||
.resolver(|addr: &str| { // force IPv4
|
||||
addr.to_socket_addrs().map(|iter| iter.filter_map(|sa| match sa.ip() {
|
||||
IpAddr::V4(ipv4) => Some(SocketAddr::new(IpAddr::V4(ipv4), sa.port())),
|
||||
_ => None,
|
||||
}).collect::<Vec<_>>())
|
||||
addr.to_socket_addrs().map(|iter| iter.filter(|&sa| matches!(sa.ip(), IpAddr::V4(_))).collect::<Vec<_>>())
|
||||
})
|
||||
.build();
|
||||
let config: Settings = read_config();
|
||||
|
|
Loading…
Reference in New Issue