mirror of
https://github.com/telemt/telemt.git
synced 2026-06-30 23:01:11 +03:00
Rustfmt
This commit is contained in:
+8
-2
@@ -409,7 +409,10 @@ mod tests {
|
|||||||
response[28..32].copy_from_slice(&[203, 0, 113, 9]);
|
response[28..32].copy_from_slice(&[203, 0, 113, 9]);
|
||||||
|
|
||||||
let reflected = parse_reflected_addr(&response, &txid).unwrap();
|
let reflected = parse_reflected_addr(&response, &txid).unwrap();
|
||||||
assert_eq!(reflected, SocketAddr::new(IpAddr::V4(Ipv4Addr::new(203, 0, 113, 9)), 443));
|
assert_eq!(
|
||||||
|
reflected,
|
||||||
|
SocketAddr::new(IpAddr::V4(Ipv4Addr::new(203, 0, 113, 9)), 443)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -436,6 +439,9 @@ mod tests {
|
|||||||
response[28..32].copy_from_slice(&xip);
|
response[28..32].copy_from_slice(&xip);
|
||||||
|
|
||||||
let reflected = parse_reflected_addr(&response, &txid).unwrap();
|
let reflected = parse_reflected_addr(&response, &txid).unwrap();
|
||||||
assert_eq!(reflected, SocketAddr::new(IpAddr::V4(Ipv4Addr::new(203, 0, 113, 9)), 443));
|
assert_eq!(
|
||||||
|
reflected,
|
||||||
|
SocketAddr::new(IpAddr::V4(Ipv4Addr::new(203, 0, 113, 9)), 443)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,9 +37,7 @@ pub async fn stun_probe(stun_addr: Option<String>) -> Result<crate::network::stu
|
|||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub async fn detect_public_ip() -> Option<IpAddr> {
|
pub async fn detect_public_ip() -> Option<IpAddr> {
|
||||||
let urls = crate::config::defaults::default_http_ip_detect_urls();
|
let urls = crate::config::defaults::default_http_ip_detect_urls();
|
||||||
detect_public_ipv4_http(&urls)
|
detect_public_ipv4_http(&urls).await.map(IpAddr::V4)
|
||||||
.await
|
|
||||||
.map(IpAddr::V4)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MePool {
|
impl MePool {
|
||||||
|
|||||||
Reference in New Issue
Block a user