|
@ -31,7 +31,7 @@ fn parse_remote_info(remote_info: &str) -> Result<IpAddr, APIError> { |
|
|
let mut remote_address = String::from(remote_info);
|
|
|
let mut remote_address = String::from(remote_info);
|
|
|
if remote_address.contains(":") {
|
|
|
if remote_address.contains(":") {
|
|
|
let last_colon_index = remote_address.rfind(":").unwrap();
|
|
|
let last_colon_index = remote_address.rfind(":").unwrap();
|
|
|
let port = remote_address.split_off(last_colon_index);
|
|
|
|
|
|
|
|
|
let _port = remote_address.split_off(last_colon_index);
|
|
|
if remote_address.starts_with("[") && remote_address.ends_with("]") {
|
|
|
if remote_address.starts_with("[") && remote_address.ends_with("]") {
|
|
|
remote_address = String::from(remote_address.trim_matches(|c| c == '[' || c == ']'))
|
|
|
remote_address = String::from(remote_address.trim_matches(|c| c == '[' || c == ']'))
|
|
|
}
|
|
|
}
|
|
|