Skip to content

Commit 3568b60

Browse files
committed
Don't .unwrap() on invalid proxies
1 parent 1290819 commit 3568b60

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/socks/v5.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ impl Socks5Stream {
198198
U: ToTargetAddr,
199199
{
200200
let mut socket = if let Some(timeout) = timeout {
201-
let addr = proxy.to_socket_addrs().unwrap().next().unwrap();
201+
let addr = proxy.to_socket_addrs()?.next().unwrap();
202202
TcpStream::connect_timeout(&addr, timeout)?
203203
} else {
204204
TcpStream::connect(proxy)?

0 commit comments

Comments
 (0)