Skip to content

Commit b5fda20

Browse files
authored
chore: fix a typo "dail"->"dial" (#744)
1 parent 5d30139 commit b5fda20

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

util/src/vnet/net.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ impl VNet {
348348
Ok(conn)
349349
}
350350

351-
pub(crate) async fn dail(
351+
pub(crate) async fn dial(
352352
&self,
353353
use_ipv4: bool,
354354
remote_addr: &str,
@@ -524,15 +524,15 @@ impl Net {
524524
}
525525
}
526526

527-
pub async fn dail(
527+
pub async fn dial(
528528
&self,
529529
use_ipv4: bool,
530530
remote_addr: &str,
531531
) -> Result<Arc<dyn Conn + Send + Sync>> {
532532
match self {
533533
Net::VNet(vnet) => {
534534
let net = vnet.lock().await;
535-
net.dail(use_ipv4, remote_addr).await
535+
net.dial(use_ipv4, remote_addr).await
536536
}
537537
Net::Ifs(_) => {
538538
let any_ip = if use_ipv4 {

util/src/vnet/net/net_test.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ async fn test_net_native_bind() -> Result<()> {
7171
}
7272

7373
#[tokio::test]
74-
async fn test_net_native_dail() -> Result<()> {
74+
async fn test_net_native_dial() -> Result<()> {
7575
let nw = Net::new(None);
7676
assert!(!nw.is_virtual(), "should be false");
7777

78-
let conn = nw.dail(true, "127.0.0.1:1234").await?;
78+
let conn = nw.dial(true, "127.0.0.1:1234").await?;
7979
let laddr = conn.local_addr()?;
8080
assert_eq!(
8181
laddr.ip().to_string(),
@@ -443,11 +443,11 @@ async fn test_net_virtual_bind_specific_port() -> Result<()> {
443443
}
444444

445445
#[tokio::test]
446-
async fn test_net_virtual_dail_lo0() -> Result<()> {
446+
async fn test_net_virtual_dial_lo0() -> Result<()> {
447447
let nw = Net::new(Some(NetConfig::default()));
448448
assert!(nw.is_virtual(), "should be true");
449449

450-
let conn = nw.dail(true, "127.0.0.1:1234").await?;
450+
let conn = nw.dial(true, "127.0.0.1:1234").await?;
451451
let laddr = conn.local_addr()?;
452452
assert_eq!(
453453
laddr.ip().to_string().as_str(),
@@ -461,7 +461,7 @@ async fn test_net_virtual_dail_lo0() -> Result<()> {
461461
}
462462

463463
#[tokio::test]
464-
async fn test_net_virtual_dail_eth0() -> Result<()> {
464+
async fn test_net_virtual_dial_eth0() -> Result<()> {
465465
let wan = Arc::new(Mutex::new(Router::new(RouterConfig {
466466
cidr: "1.2.3.0/24".to_string(),
467467
..Default::default()
@@ -479,7 +479,7 @@ async fn test_net_virtual_dail_eth0() -> Result<()> {
479479
n.set_router(Arc::clone(&wan)).await?;
480480
};
481481

482-
let conn = nw.dail(true, "27.3.4.5:1234").await?;
482+
let conn = nw.dial(true, "27.3.4.5:1234").await?;
483483
let laddr = conn.local_addr()?;
484484
assert_eq!(
485485
laddr.ip().to_string().as_str(),
@@ -523,7 +523,7 @@ async fn test_net_virtual_resolver() -> Result<()> {
523523
tokio::spawn(async move {
524524
let (conn, raddr) = {
525525
let raddr = nw.resolve_addr(true, "test.webrtc.rs:1234").await?;
526-
(nw.dail(true, "test.webrtc.rs:1234").await?, raddr)
526+
(nw.dial(true, "test.webrtc.rs:1234").await?, raddr)
527527
};
528528

529529
let laddr = conn.local_addr()?;

0 commit comments

Comments
 (0)