mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-04 02:54:00 +00:00
Fix net.rs - rsplitn() returns a reverse iterator
This commit is contained in:
parent
f68cc68e79
commit
a3174de9ff
@ -177,9 +177,8 @@ impl TryFrom<&str> for LookupHost {
|
||||
}
|
||||
|
||||
// split the string by ':' and convert the second part to u16
|
||||
let (port_str, host) = try_opt!(s.rsplit_once(':'), "invalid socket address");
|
||||
let (host, port_str) = try_opt!(s.rsplit_once(':'), "invalid socket address");
|
||||
let port: u16 = try_opt!(port_str.parse().ok(), "invalid port value");
|
||||
|
||||
(host, port).try_into()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user